/* player-stats.css */

/* Основные стили модального окна - с двойной прокруткой */
#player-stats-modal .modal-content.wide-modal {
    max-width: 1100px !important;
    width: 95% !important;
    max-height: 95vh !important;
    background:
        linear-gradient(145deg, rgba(16, 20, 30, 0.9), rgba(28, 34, 48, 0.88)),
        url('/static/aoe-back-optimized.webp') center/cover no-repeat !important;
    border-radius: 16px;
    border: 1px solid rgba(255, 223, 143, 0.16);
    box-shadow: 0 20px 44px rgba(0, 0, 0, 0.28);
    position: relative;
    margin: 20px auto;
    padding: 0;
    /* Убираем внутреннюю прокрутку у самого модального окна */
    overflow: hidden;
    transform: scale(0.97);
    transform-origin: center;
}

/* Контейнер статистики - только здесь скролл */
.player-stats-container {
    color: #fff9e7;
    padding: 12px 16px 16px 16px;
    max-width: 100%;
    overflow-x: hidden;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    /* Разрешаем прокрутку только внутри контейнера */
    max-height: calc(95vh - 40px);
    overflow-y: auto;
    overflow-x: hidden;
}

/* Стили для скроллбара внутри контейнера */
.player-stats-container::-webkit-scrollbar {
    width: 5px;
}

.player-stats-container::-webkit-scrollbar-track {
    background: rgba(30, 35, 50, 0.3);
    border-radius: 2px;
}

.player-stats-container::-webkit-scrollbar-thumb {
    background: rgba(255, 223, 143, 0.3);
    border-radius: 2px;
}

.player-stats-container::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 223, 143, 0.5);
}

.player-info-header {
    margin-bottom: 15px;
    padding: 12px;
    background: linear-gradient(180deg, rgba(37, 44, 62, 0.78), rgba(22, 27, 39, 0.78));
    border-radius: 14px;
    border: 1px solid rgba(255, 223, 143, 0.12);
    position: sticky;
    top: 0;
    z-index: 10;
    backdrop-filter: blur(5px);
}

.player-title-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    flex-wrap: wrap;
}

.player-nickname-title {
    color: #fff9e7;
    margin: 0;
    font-size: 1.3em;
    font-weight: 600;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 5px;
    flex: 1;
    min-width: 280px;
}

.player-stats-title-block {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 280px;
    flex: 1;
}

.player-stats-avatar-frame {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
    overflow: hidden;
    border-radius: 50%;
    background:
        linear-gradient(180deg, rgba(44, 53, 74, 0.94), rgba(19, 26, 40, 0.96));
    border: 1px solid rgba(255, 223, 143, 0.24);
    box-shadow:
        0 8px 18px rgba(0, 0, 0, 0.24),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.player-stats-avatar {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: rgba(255, 255, 255, 0.08);
}

.player-stats-avatar.is-broken {
    display: none;
}

.player-stats-avatar-fallback {
    color: #fff9e7;
    font-size: 1rem;
    font-weight: 800;
    line-height: 1;
}

.nickname-highlight {
    color: #ffdf8f;
    font-weight: 700;
    text-shadow: 0 0 8px rgba(255, 223, 143, 0.3);
}

.comparison-container {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.comparison-search-input {
    padding: 7px 10px;
    border: 1px solid rgba(126, 136, 164, 0.24);
    border-radius: 12px;
    background: rgba(33, 39, 56, 0.92);
    color: #fff9e7;
    font-size: 13px;
    transition: all 0.3s ease;
    width: 200px;
}

.comparison-search-input:focus {
    outline: none;
    border-color: #ffdf8f;
    box-shadow: 0 0 0 2px rgba(255, 223, 143, 0.2);
}

.compare-action-btn {
    background: linear-gradient(145deg, #ffdf8f, #e6c97d);
    border: none;
    border-radius: 5px;
    padding: 7px 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #1e2332;
    font-size: 13px;
    font-weight: bold;
    white-space: nowrap;
    min-width: 90px;
}

.compare-action-btn:hover:not(:disabled) {
    background: linear-gradient(145deg, #fff4d6, #ffdf8f);
    transform: translateY(-2px);
    box-shadow: 0 2px 6px rgba(255, 223, 143, 0.3);
}

.compare-action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.rating-chart-container {
    background:
        linear-gradient(180deg, rgba(22, 27, 39, 0.84), rgba(14, 18, 26, 0.8)),
        url('/static/aoe-back-optimized.webp') center/cover no-repeat;
    padding: 10px 14px 14px 14px;
    border-radius: 16px;
    border: 1px solid rgba(255, 223, 143, 0.12);
    margin-bottom: 15px;
    position: relative;
    overflow: hidden;
}

.rating-chart-container > .rating-chart-title {
    display: none;
}

.rating-chart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.rating-chart-title {
    color: #ffdf8f;
    text-align: center;
    margin: 0;
    font-size: 1em;
    font-weight: 600;
    padding: 0;
}

.rating-chart-zoom-controls {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.rating-zoom-btn {
    min-width: 42px;
    padding: 5px 10px;
    border-radius: 999px;
    border: 1px solid rgba(255, 223, 143, 0.24);
    background: rgba(30, 35, 50, 0.9);
    color: #fff9e7;
    cursor: pointer;
    transition: all 0.2s ease;
}

.rating-zoom-btn:hover {
    border-color: rgba(255, 223, 143, 0.5);
    color: #ffdf8f;
}

.rating-zoom-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.rating-zoom-value {
    min-width: 40px;
    color: #ffdf8f;
    font-weight: 700;
    text-align: left;
}

.rating-chart {
    height: 180px;
    width: 100%;
    max-width: 100%;
    display: block;
}

.chart-wrapper {
    position: relative;
    height: 180px;
    width: 100%;
    margin: 0 auto;
    touch-action: auto;
}

.chart-wrapper.is-pannable {
    cursor: grab;
    touch-action: pan-y;
}

.chart-wrapper.is-dragging {
    cursor: grabbing;
}

.recent-matches-section {
    margin-bottom: 15px;
    background: linear-gradient(180deg, rgba(37, 44, 62, 0.78), rgba(22, 27, 39, 0.78));
    padding: 10px 12px;
    border-radius: 14px;
    border: 1px solid rgba(255, 223, 143, 0.12);
}

.recent-matches-header {
    margin-bottom: 5px;
}

.recent-matches-title-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
}

.recent-matches-title {
    color: #ffdf8f;
    font-size: 0.95em;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
    margin: 0;
}

.recent-matches-dots {
    display: flex;
    gap: 5px;
    align-items: center;
}

.match-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.match-dot.win {
    background-color: #28a745;
    box-shadow: 0 0 3px rgba(40, 167, 69, 0.6);
}

.match-dot.loss {
    background-color: #dc3545;
    box-shadow: 0 0 3px rgba(220, 53, 69, 0.6);
}

.match-dot.unknown {
    background-color: #6c757d;
    box-shadow: 0 0 3px rgba(108, 117, 125, 0.6);
}

/* Обновленная сетка матчей - более компактная */
.recent-matches-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
}

.recent-match-card {
    background: rgba(30, 35, 50, 0.4);
    border-radius: 6px;
    padding: 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    position: relative;
    overflow: visible;
    min-height: 75px;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.recent-match-card:hover {
    border-color: rgba(255, 223, 143, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 3;
}

.recent-match-card.win {
    border-left: 2px solid #28a745;
}

.recent-match-card.loss {
    border-left: 2px solid #dc3545;
}

.match-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 4px;
    margin-bottom: 2px; /* Уменьшен отступ для нового блока */
    min-height: 24px;
}

.match-map {
    font-weight: bold;
    color: #ffdf8f;
    font-size: 0.75em;
    margin: 0;
    line-height: 1.1;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    word-break: break-word;
}

.match-header-right {
    display: flex;
    align-items: center;
    gap: 3px;
}

.rating-change-badge {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.65em;
    flex-shrink: 0;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.rating-change-badge.positive {
    background: rgba(40, 167, 69, 0.3);
    color: #86fc8a;
    border-color: rgba(40, 167, 69, 0.5);
}

.rating-change-badge.negative {
    background: rgba(220, 53, 69, 0.3);
    color: #fd8962;
    border-color: rgba(220, 53, 69, 0.5);
}

/* --- НОВЫЕ СТИЛИ для отдельной строки разницы команд --- */

.match-rating-delta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 3px 6px;
    margin-bottom: 6px;
    border-radius: 4px;
    font-size: 0.75em;
    font-weight: 500;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid transparent;
    transition: all 0.2s ease;
}

.match-rating-delta .delta-label {
    color: #b8b8b8;
    text-transform: uppercase;
    font-size: 0.7em;
    letter-spacing: 0.3px;
}

.match-rating-delta .delta-value {
    font-weight: 700;
    font-size: 0.9em;
}

/* Преимущество */
.match-rating-delta.delta-small-advantage {
    background: rgba(40, 167, 69, 0.22);
    border-color: rgba(40, 167, 69, 0.42);
}
.match-rating-delta.delta-small-advantage .delta-value {
    color: #9df0a8;
}

.match-rating-delta.delta-medium-advantage {
    background: rgba(40, 167, 69, 0.22);
    border-color: rgba(40, 167, 69, 0.42);
}
.match-rating-delta.delta-medium-advantage .delta-value {
    color: #73e081;
}

.match-rating-delta.delta-large-advantage {
    background: rgba(18, 92, 40, 0.34);
    border-color: rgba(34, 139, 34, 0.5);
}
.match-rating-delta.delta-large-advantage .delta-value {
    color: #c4f7b8;
}

/* Недостаток */
.match-rating-delta.delta-small-disadvantage {
    background: rgba(255, 193, 7, 0.22);
    border-color: rgba(255, 193, 7, 0.42);
}
.match-rating-delta.delta-small-disadvantage .delta-value {
    color: #ffe07a;
}

.match-rating-delta.delta-medium-disadvantage {
    background: rgba(253, 126, 20, 0.22);
    border-color: rgba(253, 126, 20, 0.42);
}
.match-rating-delta.delta-medium-disadvantage .delta-value {
    color: #ffb15c;
}

.match-rating-delta.delta-large-disadvantage {
    background: rgba(220, 53, 69, 0.24);
    border-color: rgba(220, 53, 69, 0.46);
}
.match-rating-delta.delta-large-disadvantage .delta-value {
    color: #ff9d9d;
}

/* Нейтральный */
.match-rating-delta.delta-neutral {
    background: rgba(108, 117, 125, 0.15);
    border-color: rgba(108, 117, 125, 0.3);
}
.match-rating-delta.delta-neutral .delta-value {
    color: #b8b8b8;
}

/* --- Скрываем старый badge разницы команд --- */
.rating-delta-badge {
    display: none;
}

.match-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.match-civ-date {
    display: flex;
    align-items: center;
    gap: 4px;
}

.match-date {
    color: #b8b8b8;
    font-size: 0.7em;
    margin: 0;
    white-space: nowrap;
}

.match-civ-icon {
    width: 18px;
    height: 18px;
    border-radius: 3px;
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 223, 143, 0.1);
    flex-shrink: 0;
}

.match-civ-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 2px;
}

.match-civ-icon.fallback .civ-fallback {
    display: flex;
    font-size: 0.6em;
}

.match-teams {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 0.7em;
}

.match-team {
    display: flex;
    align-items: center;
    gap: 3px;
    color: #b8b8b8;
    padding: 2px 4px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    min-height: 18px;
    position: relative;
    cursor: help;
}

.team-info-icon {
    width: 12px; /* Увеличено с 8px */
    height: 12px; /* Увеличено с 8px */
    border-radius: 50%;
    background: rgba(255, 223, 143, 0.2);
    color: #ffdf8f;
    font-size: 0.65em; /* Увеличено с 0.55em */
    font-weight: 600; /* Сделано жирнее */
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    line-height: 1; /* Добавлено для правильного вертикального выравнивания */
    padding-top: 1px; /* Добавлено для компенсации типографского смещения */
    border: 1px solid rgba(255, 223, 143, 0.2);
    box-sizing: border-box; /* Добавлено для правильного учета padding */
}

/* Также добавим стили для обеспечения совместимости с разными шрифтами */
.info-icon, .team-info-icon {
    font-family: 'Segoe UI', 'Arial', sans-serif; /* Явно указываем шрифт */
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.match-result-indicator {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    margin-left: auto;
    flex-shrink: 0;
}

.match-result-indicator.win {
    background-color: #28a745;
    box-shadow: 0 0 2px rgba(40, 167, 69, 0.6);
}

.match-result-indicator.loss {
    background-color: #dc3545;
    box-shadow: 0 0 2px rgba(220, 53, 69, 0.6);
}

.player-main-stats {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    margin-bottom: 15px;
}

.stat-card {
    background: rgba(30, 35, 50, 0.6);
    padding: 8px 6px;
    border-radius: 6px;
    border: 1px solid rgba(255, 223, 143, 0.2);
    text-align: center;
    transition: all 0.3s ease;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    position: relative;
    overflow: hidden;
    min-height: 50px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.stat-card:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 223, 143, 0.4);
    box-shadow: 0 2px 8px rgba(255, 223, 143, 0.1);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 223, 143, 0.1), transparent);
    transition: left 0.5s ease;
}

.stat-card:hover::before {
    left: 100%;
}

.stat-value {
    font-size: 1.1em;
    font-weight: bold;
    color: #ffdf8f;
    margin-bottom: 2px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    text-shadow: 0 0 8px rgba(255, 223, 143, 0.3);
    line-height: 1;
}

.stat-label {
    font-size: 0.75em;
    color: #b8b8b8;
    line-height: 1.1;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Статистика игроков - увеличенные карточки на 5-10% */
.players-stats-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    margin-bottom: 15px;
}

.stats-column {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.stats-column h3 {
    color: #ffdf8f;
    margin-bottom: 8px;
    text-align: center;
    font-size: 0.85em;
    font-weight: 600;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    padding: 5px 0;
    border-bottom: 1px solid rgba(255, 223, 143, 0.2);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-height: 42px;
    line-height: 1.2;
    white-space: normal;
    overflow: visible;
    text-overflow: ellipsis;
    word-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
    flex-shrink: 0;
    max-width: 100%;
}

/* Принудительный перенос слов в заголовках */
.stats-column h3 span:first-child {
    display: inline-block;
    max-width: calc(100% - 18px);
    word-break: break-word;
    white-space: normal;
    text-align: center;
}

.stats-column h3 span.info-icon {
    flex-shrink: 0;
}

.info-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px; /* Увеличено с 12px */
    height: 14px; /* Увеличено с 12px */
    border-radius: 50%;
    background: rgba(255, 223, 143, 0.2);
    color: #ffdf8f;
    font-size: 0.7em; /* Увеличено с 0.6em */
    font-weight: 600; /* Сделано жирнее */
    cursor: help;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 223, 143, 0.3);
    flex-shrink: 0;
    line-height: 1; /* Добавлено для правильного вертикального выравнивания */
    padding-top: 1px; /* Добавлено для компенсации типографского смещения */
    box-sizing: border-box; /* Добавлено для правильного учета padding */
}

.info-icon:hover {
    background: rgba(255, 223, 143, 0.3);
    transform: scale(1.1);
}

.stats-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-height: 140px;
    flex: 1;
    overflow: visible;
}

/* Увеличенные stats-item на 5-10% */
.stats-item {
    background: rgba(30, 35, 50, 0.4);
    padding: 6px 7px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    min-height: 38px;
    flex-shrink: 0;
}

.stats-item:hover {
    background: rgba(30, 35, 50, 0.7);
    border-color: rgba(255, 223, 143, 0.3);
    transform: translateX(2px);
}

.stats-item-info {
    display: flex;
    align-items: center;
    gap: 7px;
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.stats-name-container {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.stats-name-container .stats-player-name {
    font-weight: 600;
    color: #fff9e7;
    font-size: 0.8em;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
    margin-bottom: 2px;
}

.stats-name-container .stats-game-count {
    font-size: 0.7em;
    color: #b8b8b8;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.1;
    margin-top: 1px;
}

.civilization-icon {
    width: 22px;
    height: 22px;
    border-radius: 3px;
    overflow: hidden;
    position: relative;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 223, 143, 0.1);
}

.civilization-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 2px;
}

.civilization-icon.fallback {
    background: rgba(255, 223, 143, 0.1);
    border: 1px solid rgba(255, 223, 143, 0.2);
}

.civ-fallback {
    display: none;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: 0.75em;
    font-weight: bold;
    color: #ffdf8f;
    text-transform: uppercase;
}

.civilization-icon.fallback .civ-fallback {
    display: flex;
}

.stats-win-rate {
    font-weight: bold;
    padding: 3px 6px;
    border-radius: 3px;
    font-size: 0.8em;
    min-width: 40px;
    text-align: center;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    transition: all 0.3s ease;
    flex-shrink: 0;
    position: relative;
    cursor: help;
}

.wins-losses-stats {
    position: relative;
    cursor: help;
}

.player-stats-container [data-tooltip]::before,
.player-stats-container [data-tooltip]::after {
    display: none;
}

.player-stats-floating-tooltip {
    position: fixed;
    z-index: 10000;
    max-width: min(280px, calc(100vw - 16px));
    padding: 7px 9px;
    border-radius: 8px;
    color: #ffdf8f;
    background: rgba(18, 22, 32, 0.98);
    border: 1px solid rgba(255, 223, 143, 0.24);
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.38);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: 0;
    text-align: center;
    text-transform: none;
    white-space: normal;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transform: translateY(4px);
    transition: opacity 0.12s ease, transform 0.12s ease, visibility 0.12s ease;
}

.player-stats-floating-tooltip.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.match-team[data-tooltip],
.stats-win-rate[data-tooltip],
.wins-losses-stats[data-tooltip],
.info-icon[data-tooltip] {
    position: relative;
    overflow: visible;
}

.match-team[data-tooltip]::before,
.match-team[data-tooltip]::after,
.stats-win-rate[data-tooltip]::before,
.stats-win-rate[data-tooltip]::after,
.wins-losses-stats[data-tooltip]::before,
.wins-losses-stats[data-tooltip]::after,
.info-icon[data-tooltip]::before,
.info-icon[data-tooltip]::after {
    position: absolute;
    left: 50%;
    pointer-events: none;
    opacity: 0;
    transform: translate(-50%, 6px);
    transition: opacity 0.16s ease, transform 0.16s ease;
    z-index: 4000;
}

.match-team[data-tooltip]::before,
.stats-win-rate[data-tooltip]::before,
.wins-losses-stats[data-tooltip]::before,
.info-icon[data-tooltip]::before {
    content: '';
    bottom: calc(100% + 4px);
    width: 8px;
    height: 8px;
    background: rgba(18, 22, 32, 0.98);
    border-left: 1px solid rgba(255, 223, 143, 0.24);
    border-top: 1px solid rgba(255, 223, 143, 0.24);
    transform: translate(-50%, 6px) rotate(225deg);
}

.match-team[data-tooltip]::after,
.stats-win-rate[data-tooltip]::after,
.wins-losses-stats[data-tooltip]::after,
.info-icon[data-tooltip]::after {
    content: attr(data-tooltip);
    bottom: calc(100% + 8px);
    width: max-content;
    max-width: 260px;
    padding: 7px 9px;
    border-radius: 8px;
    color: #ffdf8f;
    background: rgba(18, 22, 32, 0.98);
    border: 1px solid rgba(255, 223, 143, 0.24);
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.38);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: 0;
    text-align: center;
    text-transform: none;
    white-space: normal;
}

.match-team[data-tooltip]:hover::before,
.match-team[data-tooltip]:hover::after,
.stats-win-rate[data-tooltip]:hover::before,
.stats-win-rate[data-tooltip]:hover::after,
.wins-losses-stats[data-tooltip]:hover::before,
.wins-losses-stats[data-tooltip]:hover::after,
.info-icon[data-tooltip]:hover::before,
.info-icon[data-tooltip]:hover::after {
    opacity: 1;
}

.match-team[data-tooltip]:hover::before,
.stats-win-rate[data-tooltip]:hover::before,
.wins-losses-stats[data-tooltip]:hover::before,
.info-icon[data-tooltip]:hover::before {
    transform: translate(-50%, 0) rotate(225deg);
}

.match-team[data-tooltip]:hover::after,
.stats-win-rate[data-tooltip]:hover::after,
.wins-losses-stats[data-tooltip]:hover::after,
.info-icon[data-tooltip]:hover::after {
    transform: translate(-50%, 0);
}

.win-rate-high {
    background: rgba(40, 167, 69, 0.25);
    color: #86fc8a;
    text-shadow: 0 0 4px rgba(134, 252, 138, 0.3);
}

.win-rate-medium {
    background: rgba(255, 193, 7, 0.25);
    color: #ffd351;
    text-shadow: 0 0 4px rgba(255, 211, 81, 0.3);
}

.win-rate-low {
    background: rgba(220, 53, 69, 0.25);
    color: #fd8962;
    text-shadow: 0 0 4px rgba(253, 137, 98, 0.3);
}

.wins-losses-stats {
    font-weight: bold;
    padding: 3px 6px;
    border-radius: 3px;
    font-size: 0.8em;
    min-width: 40px;
    text-align: center;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.wins-losses-stats.positive {
    color: #86fc8a;
    background: rgba(40, 167, 69, 0.2);
    text-shadow: 0 0 4px rgba(134, 252, 138, 0.3);
}

.wins-losses-stats.negative {
    color: #fd8962;
    background: rgba(220, 53, 69, 0.2);
    text-shadow: 0 0 4px rgba(253, 137, 98, 0.3);
}

.wins-losses-stats.neutral {
    color: #ffdf8f;
    background: rgba(255, 223, 143, 0.15);
    text-shadow: 0 0 4px rgba(255, 223, 143, 0.3);
}

/* БЛОК ДЕЛЬТЫ ПОЛНОСТЬЮ УДАЛЕН */

.no-data {
    color: #b8b8b8;
    text-align: center;
    padding: 12px;
    font-style: italic;
}

#player-stats-modal .close {
    color: #ffdf8f;
    font-size: 22px;
    font-weight: bold;
    position: absolute;
    top: 6px;
    right: 10px;
    z-index: 1000;
    transition: all 0.3s ease;
    cursor: pointer;
    background: rgba(30, 35, 50, 0.9);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 223, 143, 0.3);
}

#player-stats-modal .close:hover {
    color: #fff;
    text-shadow: 0 0 8px rgba(255, 223, 143, 0.8);
    transform: scale(1.1);
}

/* АДАПТИВНОСТЬ - оставляем оригинальные медиа-запросы */
@media (min-width: 1440px) {
    #player-stats-modal .modal-content.wide-modal {
        max-width: 1100px !important;
    }

    .players-stats-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 12px;
    }

    .recent-matches-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 10px;
    }

    .recent-match-card {
        min-height: 90px;
        padding: 10px;
    }
}

@media (max-width: 1440px) and (min-width: 1200px) {
    .players-stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .recent-matches-grid {
        grid-template-columns: repeat(5, 1fr);
    }

    .recent-match-card {
        min-height: 90px;
    }
}

@media (max-width: 1400px) and (min-width: 1024px) {
    .recent-matches-grid {
        gap: 6px;
    }

    .recent-match-card {
        padding: 6px;
        min-height: 85px;
    }

    .match-map {
        font-size: 0.75em;
    }

    .match-date {
        font-size: 0.7em;
    }

    .match-teams {
        font-size: 0.7em;
    }
}

@media (max-width: 1200px) and (min-width: 769px) {
    .players-stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .recent-matches-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .player-main-stats {
        grid-template-columns: repeat(4, 1fr);
    }

    .player-title-wrapper {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .comparison-container {
        width: 100%;
        justify-content: flex-end;
    }

    .comparison-search-input {
        flex: 1;
        max-width: 280px;
    }
}

@media (max-width: 768px) {
    #player-stats-modal .modal-content.wide-modal {
        width: 98% !important;
        max-height: 90vh !important;
        margin: 8px auto !important;
        border-radius: 8px !important;
        transform: none !important;
        max-width: 1100px !important;
    }

    .player-stats-container {
        padding: 10px 12px 12px 12px;
        max-height: calc(90vh - 40px);
    }

    .player-info-header {
        padding: 10px;
        margin-bottom: 8px;
        margin-top: 0;
    }

    .player-title-wrapper {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .player-nickname-title {
        font-size: 1.2em;
        text-align: center;
        min-width: auto;
        flex-direction: column;
        gap: 4px;
    }

    .player-stats-title-block {
        width: 100%;
        min-width: 0;
        justify-content: center;
    }

    .comparison-container {
        flex-direction: column;
        width: 100%;
        gap: 8px;
    }

    .comparison-search-input {
        width: 100%;
        font-size: 14px !important;
        padding: 10px;
        box-sizing: border-box;
        border-radius: 6px;
    }

    .compare-action-btn {
        width: 100%;
        padding: 10px;
        font-size: 14px;
        border-radius: 6px;
    }

    .rating-chart-container {
        padding: 12px;
        margin-bottom: 12px;
        border-radius: 8px;
    }

    .rating-chart-title {
        font-size: 1em;
    }

    .rating-chart-header {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .rating-chart-zoom-controls {
        justify-content: center;
    }

    .rating-chart {
        height: 160px;
    }

    .chart-wrapper {
        height: 160px;
    }

    .player-main-stats {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px;
        margin-bottom: 15px;
    }

    .stat-card {
        min-height: 60px !important;
        padding: 10px 6px;
        border-radius: 8px;
    }

    .stat-value {
        font-size: 1.2em;
        margin-bottom: 3px;
    }

    .stat-label {
        font-size: 0.8em;
        line-height: 1.2;
    }

    .players-stats-grid {
        grid-template-columns: 1fr !important;
        gap: 12px;
        margin-bottom: 15px;
    }

    .stats-column {
        background: rgba(30, 35, 50, 0.6);
        border-radius: 8px;
        padding: 10px;
        border: 1px solid rgba(255, 223, 143, 0.15);
    }

    .stats-column h3 {
        font-size: 1em;
        min-height: auto;
        padding: 6px 0 10px 0;
        border-bottom: 1px solid rgba(255, 223, 143, 0.15);
        margin-bottom: 10px;
        justify-content: flex-start;
        text-align: left;
    }

    .stats-list {
        min-height: auto;
        gap: 8px;
    }

    .stats-item {
        padding: 8px 10px;
        min-height: 42px;
        border-radius: 6px;
        background: rgba(0, 0, 0, 0.2);
    }

    .stats-item-info {
        gap: 10px;
    }

    .stats-name-container .stats-player-name {
        font-size: 0.9em;
        white-space: normal;
        word-break: break-word;
        line-height: 1.2;
    }

    .stats-name-container .stats-game-count {
        font-size: 0.8em;
        margin-top: 2px;
    }

    .civilization-icon {
        width: 24px;
        height: 24px;
    }

    .stats-win-rate,
    .wins-losses-stats {
        font-size: 0.9em;
        min-width: 50px;
        padding: 5px 8px;
    }

    .recent-matches-section {
        padding: 12px;
        margin-bottom: 12px;
        border-radius: 8px;
    }

    .recent-matches-title-wrapper {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .recent-matches-title {
        font-size: 1em;
    }

    .recent-matches-dots {
        align-self: flex-start;
    }

    .recent-matches-grid {
        grid-template-columns: 1fr !important;
        gap: 10px;
    }

    .recent-match-card {
        min-height: 95px;
        padding: 10px;
        border-radius: 8px;
        font-size: 0.9em;
    }

    .match-header {
        margin-bottom: 8px;
        min-height: 28px;
    }

    .match-map {
        font-size: 0.9em;
        -webkit-line-clamp: 1;
    }

    .rating-change-badge {
        width: 24px;
        height: 24px;
        font-size: 0.8em;
    }

    /* Адаптация нового блока разницы команд для мобильных */
    .match-rating-delta {
        font-size: 0.8em;
        padding: 4px 8px;
        margin-bottom: 8px;
    }

    .match-rating-delta .delta-label {
        font-size: 0.75em;
    }

    .match-rating-delta .delta-value {
        font-size: 1em;
    }

    .match-content {
        gap: 8px;
    }

    .match-civ-date {
        gap: 8px;
    }

    .match-civ-icon {
        width: 24px;
        height: 24px;
    }

    .match-date {
        font-size: 0.85em;
    }

    .match-teams {
        gap: 6px;
        font-size: 0.85em;
    }

    .match-team {
        padding: 6px 8px;
        min-height: 28px;
    }
}

@media (max-width: 480px) {
    #player-stats-modal .modal-content.wide-modal {
        width: 100% !important;
        max-height: 100vh !important;
        margin: 0 !important;
        border-radius: 0 !important;
        max-width: 1100px !important;
    }

    .player-stats-container {
        padding: 10px 8px 12px 8px;
        max-height: calc(100vh - 40px);
    }

    #player-stats-modal .close {
        top: 8px !important;
        right: 8px !important;
    }

    .player-stats-title-block {
        gap: 9px;
    }

    .player-stats-avatar-frame {
        width: 40px;
        height: 40px;
        flex-basis: 40px;
    }

    .stat-card {
        min-height: 55px !important;
        padding: 8px 5px;
    }

    .stat-value {
        font-size: 1.1em;
    }

    .stat-label {
        font-size: 0.75em;
    }

    .stats-column {
        padding: 8px;
    }

    .stats-item {
        padding: 6px 8px;
        min-height: 38px;
    }

    .stats-name-container .stats-player-name {
        font-size: 0.85em;
    }

    .recent-match-card {
        padding: 8px;
        min-height: 90px;
    }

    /* На очень маленьких экранах скрываем label, оставляем только значение */
    .match-rating-delta .delta-label {
        display: none;
    }

    .match-rating-delta {
        justify-content: center;
    }

    .match-rating-delta .delta-value {
        font-size: 0.9em;
    }
}

@media (max-width: 360px) {
    .player-stats-container {
        padding: 8px 6px 10px 6px;
        max-height: calc(100vh - 40px);
    }

    .stat-card {
        min-height: 50px !important;
    }

    .stat-value {
        font-size: 1em;
    }

    .stat-label {
        font-size: 0.7em;
    }

    .stats-column {
        padding: 6px;
    }

    .stats-item {
        padding: 5px 6px;
        min-height: 35px;
    }

    .stats-name-container .stats-player-name {
        font-size: 0.8em;
    }

    .recent-match-card {
        padding: 6px;
        min-height: 85px;
    }
}

@media (max-height: 600px) and (orientation: landscape) and (max-width: 768px) {
    #player-stats-modal .modal-content.wide-modal {
        max-height: 95vh !important;
        max-width: 1100px !important;
    }

    .player-stats-container {
        padding: 10px;
        max-height: calc(95vh - 40px);
    }

    .player-main-stats {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 6px;
    }

    .stat-card {
        min-height: 50px !important;
        padding: 6px 3px;
    }

    .players-stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px;
    }

    .rating-chart {
        height: 120px;
    }

    .chart-wrapper {
        height: 120px;
    }

    .recent-matches-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 6px;
    }

    .recent-match-card {
        min-height: 75px;
        padding: 6px;
    }
}

@media (min-width: 768px) and (max-width: 1024px) {
    #player-stats-modal .modal-content.wide-modal {
        width: 90% !important;
        max-width: 800px !important;
    }

    .players-stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .player-main-stats {
        grid-template-columns: repeat(4, 1fr) !important;
    }

    .recent-matches-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .player-title-wrapper {
        flex-direction: row;
        align-items: center;
    }

    .comparison-container {
        flex-direction: row;
        width: auto;
    }

    .comparison-search-input {
        width: 160px;
    }

    .compare-action-btn {
        width: auto;
    }
}

@keyframes modalAppear {
    from {
        opacity: 0;
        transform: scale(0.97) translateY(-8px);
    }
    to {
        opacity: 1;
        transform: scale(0.97) translateY(0);
    }
}

.wide-modal {
    animation: none;
}

/* Modern player stats dashboard */
#player-stats-modal .modal-content.wide-modal {
    max-width: 1600px !important;
    background:
        linear-gradient(145deg, rgba(6, 12, 20, 0.96), rgba(12, 22, 34, 0.94)),
        url('/static/aoe-back-optimized.webp') center/cover no-repeat !important;
    border: 1px solid rgba(129, 146, 168, 0.32);
    border-radius: 8px;
}

.modern-player-stats {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    gap: 12px;
    color: #f3f7fb;
    padding: 16px;
    background: rgba(3, 8, 14, 0.52);
}

.player-stats-sidebar,
.modern-player-stats .rating-chart-container,
.modern-player-stats .stat-card,
.modern-list-card {
    background: linear-gradient(180deg, rgba(14, 24, 36, 0.9), rgba(7, 13, 22, 0.88));
    border: 1px solid rgba(129, 146, 168, 0.28);
    border-radius: 8px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.player-stats-sidebar {
    padding: 18px;
    min-width: 0;
}

.modern-player-stats .player-info-header {
    position: static;
    padding: 0;
    margin: 0 0 22px 0;
    background: transparent;
    border: 0;
}

.modern-player-stats .player-title-wrapper {
    display: block;
}

.modern-player-stats .player-stats-title-block {
    min-width: 0;
    gap: 14px;
}

.modern-player-stats .player-stats-avatar-frame {
    width: 86px;
    height: 86px;
    flex-basis: 86px;
    border: 2px solid rgba(218, 226, 236, 0.45);
}

.modern-player-heading {
    min-width: 0;
}

.modern-player-stats .player-nickname-title {
    min-width: 0;
    display: block;
    font-size: 1.25rem;
    line-height: 1.15;
    color: #f7fafc;
    text-align: left;
}

.modern-rating-summary {
    padding: 20px;
    margin-bottom: 26px;
    border-radius: 8px;
    border: 1px solid rgba(129, 146, 168, 0.24);
    background: rgba(15, 25, 38, 0.72);
}

.modern-rating-summary strong {
    display: block;
    font-size: 2.25rem;
    line-height: 1;
    color: #f7fafc;
}

.modern-rating-summary span,
.modern-rating-summary small {
    display: block;
    color: #b7c0cb;
    margin-top: 8px;
}

.modern-rating-summary b,
.modern-rating-summary .positive,
.stat-value.positive,
.modern-rating-change.positive {
    color: #65df6f;
}

.modern-rating-summary .negative,
.stat-value.negative,
.modern-rating-change.negative {
    color: #ff5f59;
}

.modern-rating-summary .rating-delta-positive,
.stat-value.rating-delta-positive,
.modern-rating-change.rating-delta-positive {
    color: #65df6f;
}

.modern-rating-summary .rating-delta-negative,
.stat-value.rating-delta-negative,
.modern-rating-change.rating-delta-negative {
    color: #ff5f59;
}

.modern-rating-summary .rating-delta-neutral,
.stat-value.rating-delta-neutral,
.modern-rating-change.rating-delta-neutral {
    color: #b7c0cb;
}

.player-stats-nav {
    display: grid;
    gap: 10px;
}

.stats-nav-button {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-height: 56px;
    padding: 0 16px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: #aeb8c4;
    font: inherit;
    font-size: 1rem;
    text-align: left;
    cursor: pointer;
    transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.stats-nav-button:hover,
.stats-nav-button.active {
    color: #ffc128;
    background: linear-gradient(90deg, rgba(255, 193, 40, 0.16), rgba(255, 255, 255, 0.04));
    border-color: rgba(255, 193, 40, 0.16);
}

.player-stats-main {
    min-width: 0;
}

.player-stats-tab-panel {
    display: none;
}

.player-stats-tab-panel.active {
    display: block;
}

.modern-player-stats .rating-chart-container {
    padding: 22px 26px;
    margin-bottom: 14px;
    overflow: hidden;
}

.modern-player-stats .rating-chart-title {
    color: #f5f7fb;
    font-size: 1.12rem;
    text-align: left;
}

.modern-player-stats .chart-wrapper,
.modern-player-stats .rating-chart {
    height: 210px;
}

.modern-player-stats .rating-zoom-btn {
    min-width: 68px;
    border-radius: 8px;
    border-color: rgba(129, 146, 168, 0.32);
    background: rgba(8, 14, 24, 0.9);
}

.modern-player-stats .player-main-stats {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

.modern-player-stats .stat-card {
    min-height: 116px;
    padding: 18px 12px;
}

.modern-player-stats .stat-value {
    color: #f7fafc;
    font-size: 2rem;
    margin-bottom: 9px;
    text-shadow: none;
}

.modern-player-stats .stat-label {
    color: #c1c8d0;
    font-size: 0.96rem;
}

.modern-overview-grid {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(220px, 1fr) minmax(220px, 1fr);
    gap: 12px;
}

.modern-section-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.modern-section-grid.three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.modern-list-card {
    padding: 18px 20px;
    min-width: 0;
}

.modern-list-card h3 {
    margin: 0 0 14px 0;
    color: #f5f7fb;
    font-size: 1.05rem;
    line-height: 1.2;
}

.modern-list {
    display: grid;
    gap: 8px;
}

.modern-mini-row,
.modern-match-row,
.modern-empty-row {
    min-height: 42px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border-radius: 6px;
    background: rgba(12, 20, 31, 0.72);
}

.modern-mini-row {
    justify-content: space-between;
}

.modern-row-name {
    display: grid;
    min-width: 0;
    gap: 2px;
}

.modern-row-name.has-icon {
    grid-template-columns: auto minmax(0, 1fr);
    column-gap: 8px;
    align-items: center;
}

.modern-row-name.has-icon small {
    grid-column: 2;
}

.modern-row-name span {
    min-width: 0;
    color: #edf2f7;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.modern-row-name small,
.modern-match-main small,
.modern-match-date {
    color: #8994a3;
    font-size: 0.75rem;
}

.modern-mini-row strong,
.modern-score,
.modern-team-delta,
.modern-rating-change {
    flex: 0 0 auto;
    min-width: 54px;
    text-align: right;
    font-weight: 800;
}

.modern-match-row {
    display: grid;
    grid-template-columns: minmax(190px, 1fr) 110px 70px 64px 28px;
}

.modern-match-main {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.modern-match-main > div {
    display: grid;
    min-width: 0;
}

.modern-match-main strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.modern-match-result {
    font-weight: 700;
}

.modern-match-result.win {
    color: #65df6f;
}

.modern-match-result.loss {
    color: #ff5f59;
}

.modern-team-delta.delta-large-advantage,
.modern-team-delta.delta-medium-advantage,
.modern-team-delta.delta-small-advantage {
    color: #65df6f;
}

.modern-team-delta.delta-small-disadvantage,
.modern-team-delta.delta-medium-disadvantage {
    color: #ffc128;
}

.modern-team-delta.delta-large-disadvantage {
    color: #ff5f59;
}

.modern-match-info {
    width: 24px;
    height: 24px;
    border: 1px solid rgba(129, 146, 168, 0.32);
    border-radius: 50%;
    background: rgba(15, 25, 38, 0.9);
    color: #ffc128;
    cursor: help;
}

.modern-empty-row {
    justify-content: center;
    color: #8994a3;
}

.modern-player-stats .comparison-container {
    margin-top: 14px;
    display: grid;
    gap: 8px;
}

.modern-player-stats .comparison-search-input,
.modern-player-stats .compare-action-btn {
    width: 100%;
    border-radius: 8px;
}

@media (max-width: 1180px) {
    .modern-player-stats {
        grid-template-columns: 260px minmax(0, 1fr);
    }

    .modern-overview-grid,
    .modern-section-grid.three {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    .modern-player-stats {
        display: block;
        padding: 12px;
    }

    .player-stats-sidebar {
        margin-bottom: 12px;
    }

    .player-stats-nav {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .modern-player-stats .player-main-stats,
    .modern-section-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    .modern-match-row {
        grid-template-columns: minmax(0, 1fr) auto auto;
    }

    .modern-team-delta,
    .modern-match-info {
        display: none;
    }
}

@media (max-width: 560px) {
    .modern-player-stats {
        padding: 8px;
    }

    .modern-player-stats .player-stats-title-block {
        align-items: center;
    }

    .player-stats-nav,
    .modern-player-stats .player-main-stats,
    .modern-section-grid {
        grid-template-columns: 1fr !important;
    }

    .modern-player-stats .rating-chart-container,
    .modern-list-card,
    .player-stats-sidebar {
        padding: 14px;
    }

    .modern-player-stats .stat-card {
        min-height: 86px !important;
    }

    .modern-player-stats .stat-value {
        font-size: 1.55rem;
    }

    .modern-match-row {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .modern-rating-change {
        display: none;
    }
}

.modern-player-stats .stat-value.win-rate-high,
.modern-player-stats .stat-value.positive {
    color: #65df6f;
}

.modern-player-stats .stat-value.win-rate-medium {
    color: #ffc128;
}

.modern-player-stats .stat-value.win-rate-low,
.modern-player-stats .stat-value.negative {
    color: #ff5f59;
}

/* Closer to the esports card reference */
#player-stats-modal .modal-content.wide-modal {
    max-width: 1600px !important;
    background:
        radial-gradient(circle at 22% 8%, rgba(27, 79, 117, 0.16), transparent 34%),
        linear-gradient(145deg, rgba(3, 10, 18, 0.98), rgba(5, 14, 24, 0.97)) !important;
    border-color: rgba(41, 70, 96, 0.58);
    box-shadow: 0 28px 70px rgba(0, 0, 0, 0.54);
}

.modern-player-stats {
    grid-template-columns: 243px minmax(0, 1fr);
    gap: 14px;
    padding: 6px;
    max-width: 1600px;
    margin: 0 auto;
    font-family: "Inter", "Segoe UI", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.45;
    font-weight: 400;
    background:
        radial-gradient(circle at 82% 16%, rgba(32, 78, 117, 0.12), transparent 36%),
        rgba(2, 8, 15, 0.82);
}

.player-stats-sidebar,
.modern-player-stats .rating-chart-container,
.modern-player-stats .stat-card,
.modern-list-card,
.modern-footer-stats {
    background:
        linear-gradient(145deg, rgba(8, 20, 33, 0.94), rgba(3, 11, 20, 0.94));
    border-color: rgba(37, 67, 93, 0.7);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.035),
        0 18px 36px rgba(0, 0, 0, 0.18);
}

.player-stats-sidebar {
    display: flex;
    flex-direction: column;
    min-height: 854px;
    padding: 14px;
}

.modern-player-stats .player-info-header {
    margin-bottom: 14px;
}

.modern-player-stats .player-stats-avatar-frame {
    width: 74px;
    height: 74px;
    flex-basis: 74px;
    border-color: rgba(242, 191, 78, 0.65);
    box-shadow: 0 0 0 3px rgba(242, 191, 78, 0.08), 0 14px 30px rgba(0, 0, 0, 0.4);
}

.modern-player-stats .player-nickname-title {
    font-size: 1.18rem;
    font-weight: 650;
    letter-spacing: 0;
    color: #f4f7fb;
    text-shadow: none;
}

.modern-player-stats .nickname-highlight {
    color: inherit;
    text-shadow: none;
}

.modern-player-stats .comparison-container {
    margin-top: 16px;
}

.modern-player-stats .comparison-search-input {
    min-height: 36px;
    border: 1px solid rgba(47, 76, 105, 0.78);
    background: rgba(4, 14, 25, 0.94);
    color: #dce6ef;
}

.modern-player-stats .compare-action-btn {
    min-height: 36px;
    border: 0;
    background: linear-gradient(180deg, #ffe383, #e9b94d);
    color: #49350f;
    box-shadow: 0 8px 22px rgba(242, 191, 78, 0.24);
}

.modern-rating-summary {
    position: relative;
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr);
    align-items: center;
    gap: 14px;
    min-height: 132px;
    margin-bottom: 16px;
    padding: 14px 16px;
    background:
        radial-gradient(circle at 27% 50%, rgba(242, 191, 78, 0.16), transparent 34%),
        rgba(7, 20, 34, 0.88);
}

.modern-rating-summary::before {
    content: '⚜';
    display: grid;
    place-items: center;
    width: 76px;
    height: 76px;
    border-radius: 50%;
    border: 1px solid rgba(242, 191, 78, 0.35);
    color: #f3c655;
    font-size: 2.1rem;
    background: linear-gradient(145deg, rgba(242, 191, 78, 0.16), rgba(7, 20, 34, 0.8));
}

.modern-rating-summary strong {
    font-size: 2rem;
    font-weight: 750;
    color: #f8fbff;
}

.modern-rating-summary span {
    color: #c5ced8;
    font-size: 0.98rem;
    font-weight: 500;
}

.modern-rating-summary small {
    color: #9ba7b5;
    font-size: 0.88rem;
    font-weight: 400;
}

.modern-rating-summary b {
    display: block;
    grid-column: 2;
    margin-top: -16px;
    font-size: 0.86rem;
    font-weight: 650;
}

.modern-rating-summary::before {
    content: none;
}

.modern-rating-rank {
    display: grid;
    place-items: center;
    width: 96px;
    height: 96px;
    box-sizing: border-box;
    padding: 5px;
    border-radius: 10px;
    overflow: visible;
    background: radial-gradient(circle at 50% 45%, rgba(242, 191, 78, 0.13), transparent 64%);
}

.modern-rating-rank img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 10px 22px rgba(0, 0, 0, 0.34));
}

.modern-rating-main {
    min-width: 0;
}

.modern-rating-summary .rating-delta-positive {
    color: #65df6f;
}

.modern-rating-summary .rating-delta-negative {
    color: #ff5f59;
}

.modern-rating-summary .rating-delta-neutral {
    color: #b7c0cb;
}

.player-stats-nav {
    gap: 8px;
}

.stats-nav-button {
    min-height: 50px;
    border-radius: 7px;
    color: #95a4b4;
}

.stats-nav-button:hover,
.stats-nav-button.active {
    color: #ffd76a;
    background:
        linear-gradient(90deg, rgba(242, 191, 78, 0.18), rgba(242, 191, 78, 0.03));
    border-color: rgba(242, 191, 78, 0.18);
}

.modern-favorite-civ {
    margin-top: auto;
    padding: 18px 16px;
    border: 1px solid rgba(37, 67, 93, 0.7);
    border-radius: 8px;
    background: rgba(5, 16, 28, 0.82);
}

.modern-favorite-civ > span {
    display: block;
    margin-bottom: 14px;
    color: #f4f7fb;
    font-size: 0.95rem;
    font-weight: 650;
}

.modern-favorite-civ-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.modern-favorite-civ-content .civilization-icon {
    width: 42px;
    height: 42px;
}

.modern-favorite-civ-content strong {
    display: block;
    color: #f5f8fb;
    font-size: 0.94rem;
    font-weight: 500;
}

.modern-favorite-civ-content small {
    display: block;
    color: #8f9cab;
    margin-top: 4px;
    font-weight: 400;
}

.modern-player-stats .rating-chart-container {
    min-height: 306px;
    padding: 26px;
}

.modern-player-stats .chart-wrapper,
.modern-player-stats .rating-chart {
    height: 238px;
}

.modern-player-stats .rating-chart-title,
.modern-list-card h3 {
    color: #f4f7fb;
    font-weight: 650;
    text-shadow: none;
}

.modern-player-stats .rating-zoom-value,
.modern-player-stats .rating-zoom-btn {
    min-width: 60px;
    height: 32px;
    border-radius: 8px;
}

.modern-player-stats .rating-zoom-value {
    display: inline-grid;
    place-items: center;
    background: rgba(242, 191, 78, 0.08);
    border: 1px solid rgba(242, 191, 78, 0.24);
}

.modern-player-stats .player-main-stats {
    gap: 12px;
    margin-bottom: 14px;
}

.modern-player-stats .stat-card {
    min-height: 110px;
    background:
        radial-gradient(circle at 18% 10%, rgba(45, 94, 137, 0.14), transparent 42%),
        linear-gradient(145deg, rgba(9, 24, 39, 0.94), rgba(4, 12, 22, 0.94));
}

.modern-player-stats .stat-value {
    font-size: 2.05rem;
    font-weight: 750;
}

.modern-player-stats .stat-label {
    color: #9ba7b5;
    font-size: 0.9rem;
    font-weight: 400;
}

.modern-overview-grid {
    grid-template-columns: minmax(0, 1.7fr) minmax(250px, 1.08fr) minmax(250px, 1.08fr);
    gap: 12px;
}

.modern-list-card {
    padding: 24px 18px 16px;
}

.modern-list-card h3 {
    margin-bottom: 18px;
    font-size: 1rem;
}

.modern-mini-row,
.modern-match-row,
.modern-empty-row {
    min-height: 52px;
    padding: 10px 12px;
    background: transparent;
    border-bottom: 1px solid rgba(36, 62, 86, 0.34);
    border-radius: 0;
}

.modern-mini-row {
    position: relative;
    padding-left: 22px;
}

.modern-mini-row::before {
    content: '';
    position: absolute;
    left: 0;
    top: 9px;
    bottom: 9px;
    width: 4px;
    border-radius: 999px;
    background: #4d8dff;
}

.modern-mini-row:nth-child(3n + 1)::before {
    background: #ff7b2c;
}

.modern-mini-row:nth-child(3n + 2)::before {
    background: #4d8dff;
}

.modern-mini-row:nth-child(3n)::before {
    background: #e06bbd;
}

.modern-row-name span,
.modern-match-main strong {
    color: #f3f7fb;
    font-weight: 500;
}

.modern-row-name small,
.modern-match-main small {
    color: #8f9cab;
    font-size: 0.78rem;
    font-weight: 400;
}

.modern-mini-row strong.win-rate-high,
.modern-mini-row strong.win-rate-medium,
.modern-mini-row strong.win-rate-low {
    min-width: 64px;
    padding: 5px 9px;
    border-radius: 3px;
    background: rgba(39, 142, 78, 0.28);
    color: #a8f0b7;
    text-align: center;
}

.modern-score.positive,
.modern-score.neutral,
.modern-score.negative {
    padding: 5px 9px;
    border-radius: 3px;
    text-align: center;
}

.modern-match-row {
    grid-template-columns: minmax(180px, 1fr) 118px 58px 58px 28px;
}

.modern-match-row .match-civ-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
}

.modern-match-result.win {
    color: #4fe36d;
}

.modern-match-result.loss,
.modern-rating-change.negative {
    color: #ff5f59;
}

.modern-rating-change.positive {
    color: #4fe36d;
}

.modern-player-stats {
    color: #e7ebf0;
    background:
        radial-gradient(circle at 70% 14%, rgba(31, 46, 63, 0.22), transparent 38%),
        #050b12;
}

#player-stats-modal .modal-content.wide-modal {
    background:
        radial-gradient(circle at 50% 0%, rgba(31, 46, 63, 0.22), transparent 42%),
        linear-gradient(145deg, #050a10, #070d14) !important;
    border-color: rgba(58, 70, 84, 0.85);
}

.player-stats-sidebar,
.modern-player-stats .rating-chart-container,
.modern-player-stats .stat-card,
.modern-list-card,
.modern-footer-stats,
.modern-rating-summary,
.modern-favorite-civ {
    background:
        radial-gradient(circle at 18% 4%, rgba(45, 57, 71, 0.18), transparent 34%),
        linear-gradient(145deg, rgba(10, 17, 26, 0.97), rgba(5, 11, 18, 0.97));
    border: 1px solid rgba(59, 72, 88, 0.82);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.035),
        0 14px 32px rgba(0, 0, 0, 0.18);
}

.modern-player-stats .rating-chart-container {
    min-height: 318px;
    padding: 22px 24px 18px;
}

.modern-player-stats .chart-wrapper,
.modern-player-stats .rating-chart {
    height: 246px;
}

.modern-player-stats .rating-chart-title,
.modern-list-card h3 {
    color: #f0f3f7;
    font-size: 0.98rem;
    font-weight: 700;
    line-height: 1.2;
    text-shadow: none;
}

.modern-player-stats .rating-zoom-btn,
.modern-player-stats .rating-zoom-value {
    min-width: 58px;
    height: 32px;
    border: 1px solid rgba(59, 72, 88, 0.82);
    border-radius: 7px;
    background: rgba(9, 15, 23, 0.92);
    color: #c9ced6;
    box-shadow: none;
}

.modern-player-stats .rating-zoom-value,
.modern-player-stats .rating-zoom-btn:hover {
    background: rgba(36, 43, 51, 0.95);
    color: #f0f3f7;
}

.stats-nav-button:hover,
.stats-nav-button.active {
    color: #ffc21a;
    background:
        linear-gradient(90deg, rgba(255, 194, 26, 0.16), rgba(255, 255, 255, 0.045));
    border-color: rgba(255, 194, 26, 0.26);
}

.modern-player-stats .stat-card {
    justify-content: center;
    min-height: 106px;
    text-align: center;
    background:
        radial-gradient(circle at 22% 8%, rgba(45, 57, 71, 0.16), transparent 42%),
        linear-gradient(145deg, rgba(9, 16, 24, 0.98), rgba(5, 10, 17, 0.98));
}

.modern-player-stats .stat-value {
    color: #f4f7fb;
    font-size: 2rem;
    line-height: 1.05;
}

.modern-player-stats .stat-value.win-rate-high,
.modern-player-stats .stat-value.positive,
.modern-rating-change.positive,
.modern-match-result.win,
.modern-mini-row strong.win-rate-high {
    color: #55d866;
}

.modern-player-stats .stat-value.win-rate-low,
.modern-player-stats .stat-value.negative,
.modern-rating-change.negative,
.modern-match-result.loss,
.modern-mini-row strong.win-rate-low {
    color: #ff554d;
}

.modern-player-stats .stat-label {
    color: #a5adb8;
    font-size: 0.92rem;
}

.modern-overview-grid {
    grid-template-columns: minmax(420px, 1.8fr) minmax(210px, 0.9fr) minmax(210px, 0.9fr);
    align-items: stretch;
}

.modern-list-card {
    padding: 16px 16px 14px;
}

.modern-list-card h3 {
    margin-bottom: 12px;
    text-align: left;
}

.modern-mini-row,
.modern-match-row,
.modern-empty-row {
    min-height: 42px;
    padding: 9px 10px;
    background:
        linear-gradient(180deg, rgba(26, 39, 54, 0.74), rgba(13, 24, 36, 0.76));
    border: 0;
    border-bottom: 1px solid rgba(42, 55, 70, 0.52);
    border-radius: 6px;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.035),
        0 6px 16px rgba(0, 0, 0, 0.12);
}

.modern-mini-row + .modern-mini-row,
.modern-match-row + .modern-match-row {
    margin-top: 2px;
}

.modern-mini-row {
    padding-left: 10px;
    background:
        linear-gradient(180deg, rgba(28, 42, 58, 0.76), rgba(14, 25, 38, 0.78));
}

.modern-mini-row::before {
    display: none;
}

.modern-mini-row strong.win-rate-high,
.modern-mini-row strong.win-rate-medium,
.modern-mini-row strong.win-rate-low {
    min-width: 68px;
    padding: 4px 8px;
    border-radius: 4px;
    background: rgba(33, 112, 67, 0.36);
    font-weight: 700;
}

.modern-mini-row strong.win-rate-medium {
    color: #ffc21a;
    background: rgba(255, 194, 26, 0.13);
}

.modern-row-name span,
.modern-match-main strong {
    color: #eef2f6;
    font-size: 0.88rem;
    font-weight: 500;
}

.modern-row-name small,
.modern-match-main small {
    color: #9ba5b1;
    font-size: 0.78rem;
}

.modern-match-row {
    grid-template-columns: minmax(0, 1fr) 92px 52px;
    column-gap: 12px;
    align-items: center;
}

.modern-match-row.loss {
    background:
        linear-gradient(180deg, rgba(42, 34, 44, 0.78), rgba(22, 24, 34, 0.8));
}

.modern-match-main {
    min-width: 0;
}

.modern-match-main > div:last-child {
    min-width: 0;
}

.modern-match-main strong,
.modern-match-main small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.modern-match-result,
.modern-rating-change {
    font-size: 0.86rem;
    font-weight: 700;
    text-align: right;
}

.modern-team-delta {
    display: none;
}

.modern-card-action {
    width: 100%;
    min-height: 36px;
    margin-top: 10px;
    border: 1px solid rgba(59, 72, 88, 0.82);
    border-radius: 7px;
    background: rgba(9, 15, 23, 0.82);
    color: #aeb6c1;
    font: inherit;
    font-size: 0.86rem;
    font-weight: 700;
    cursor: pointer;
    transition: border-color 0.16s ease, color 0.16s ease, background 0.16s ease;
}

.modern-card-action:hover {
    color: #ffc21a;
    border-color: rgba(255, 194, 26, 0.28);
    background: rgba(255, 194, 26, 0.08);
}

.modern-footer-stats {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 0;
    margin-top: 16px;
    padding: 18px 14px;
    border-radius: 8px;
}

.modern-footer-stat {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    padding: 0 18px;
    border-right: 1px solid rgba(37, 67, 93, 0.62);
}

.modern-footer-stat:last-child {
    border-right: 0;
}

.modern-footer-stat > span {
    flex: 0 0 auto;
    color: #d49b21;
    font-size: 1.8rem;
}

.modern-footer-stat.danger > span {
    color: #e34b31;
}

.modern-footer-stat small,
.modern-footer-stat em {
    display: block;
    color: #8d9bab;
    font-style: normal;
    line-height: 1.2;
}

.modern-footer-stat strong {
    display: block;
    color: #f5f8fb;
    font-size: 1.2rem;
    line-height: 1.35;
}

.modern-player-stats .modern-overview-grid > .modern-list-card > h3,
.modern-player-stats .modern-list-card.modern-recent-card > h3 {
    margin: 0 0 12px;
    color: #f4f7fb;
    font-size: 0.88rem;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 0;
    text-align: left;
    text-shadow: none;
}

.modern-player-stats .modern-overview-grid .modern-mini-row strong.win-rate-high,
.modern-player-stats .modern-overview-grid .modern-mini-row strong.win-rate-medium,
.modern-player-stats .modern-overview-grid .modern-mini-row strong.win-rate-low {
    min-width: 54px;
    padding: 0;
    border-radius: 0;
    background: transparent;
    font-size: 0.88rem;
    font-weight: 700;
    line-height: 1.2;
    text-align: right;
}

.modern-player-stats .modern-overview-grid .modern-mini-row strong.win-rate-high {
    color: #55d866;
}

.modern-player-stats .modern-overview-grid .modern-mini-row strong.win-rate-medium {
    color: #ffc21a;
}

.modern-player-stats .modern-overview-grid .modern-mini-row strong.win-rate-low {
    color: #ff554d;
}

@media (max-width: 1180px) {
    .modern-footer-stats {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        row-gap: 18px;
    }

    .modern-footer-stat:nth-child(3n) {
        border-right: 0;
    }
}

@media (max-width: 900px) {
    .player-stats-sidebar {
        min-height: auto;
    }

    .modern-favorite-civ {
        margin-top: 14px;
    }

    .modern-footer-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .modern-footer-stat:nth-child(2n) {
        border-right: 0;
    }
}

@media (max-width: 560px) {
    .modern-rating-summary {
        grid-template-columns: 72px minmax(0, 1fr);
    }

    .modern-rating-summary::before {
        width: 60px;
        height: 60px;
        font-size: 1.6rem;
    }

    .modern-rating-rank {
        width: 72px;
        height: 72px;
    }

    .modern-footer-stats {
        grid-template-columns: 1fr;
    }

    .modern-footer-stat {
        border-right: 0;
        border-bottom: 1px solid rgba(37, 67, 93, 0.62);
        padding: 12px 4px;
    }

    .modern-footer-stat:last-child {
        border-bottom: 0;
    }
}

/* Reference-style player stats dashboard */
#player-stats-modal .modal-content.wide-modal {
    width: calc(100vw - 24px) !important;
    max-width: 1200px !important;
    max-height: calc(100vh - 24px) !important;
    border: 1px solid rgba(168, 116, 26, 0.48);
    border-radius: 10px;
    background:
        radial-gradient(circle at 18% 10%, rgba(28, 63, 92, 0.2), transparent 28%),
        linear-gradient(145deg, #030910, #07111b 56%, #04090f) !important;
    box-shadow: 0 30px 82px rgba(0, 0, 0, 0.58);
}

.modern-player-stats {
    grid-template-columns: 252px minmax(0, 1fr);
    gap: 15px;
    min-height: min(920px, calc(100vh - 28px));
    max-height: calc(100vh - 28px);
    max-width: 1200px;
    padding: 0;
    overflow-y: auto;
    color: #f2f4f7;
    background:
        linear-gradient(90deg, rgba(5, 13, 22, 0.98) 0 252px, rgba(8, 16, 25, 0.78) 252px 253px, transparent 253px),
        radial-gradient(circle at 80% 28%, rgba(146, 110, 23, 0.12), transparent 34%),
        #040a11;
    border-radius: 10px;
}

.modern-player-stats .player-stats-sidebar,
.modern-player-stats .rating-chart-container,
.modern-player-stats .stat-card,
.modern-player-stats .modern-list-card,
.modern-player-stats .modern-rating-summary,
.modern-player-stats .modern-favorite-civ {
    border: 1px solid rgba(165, 112, 22, 0.34);
    border-radius: 8px;
    background:
        linear-gradient(135deg, rgba(11, 22, 34, 0.94), rgba(5, 13, 22, 0.96));
    box-shadow:
        inset 0 1px 0 rgba(255, 226, 150, 0.055),
        0 16px 34px rgba(0, 0, 0, 0.2);
}

.modern-player-stats .player-stats-sidebar {
    min-height: 100%;
    padding: 26px 20px 20px;
    border-width: 0 1px 0 0;
    border-radius: 10px 0 0 10px;
    background:
        radial-gradient(circle at 50% 6%, rgba(27, 76, 111, 0.2), transparent 24%),
        linear-gradient(180deg, rgba(7, 17, 28, 0.96), rgba(4, 11, 19, 0.98));
}

.modern-player-stats .player-info-header {
    margin: 0 0 18px;
}

.modern-player-stats .player-stats-title-block {
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.modern-player-stats .player-stats-avatar-frame {
    width: 110px;
    height: 110px;
    flex-basis: 110px;
    border: 1px solid #c79624;
    box-shadow:
        0 0 0 3px rgba(255, 199, 44, 0.08),
        0 18px 34px rgba(0, 0, 0, 0.46);
}

.modern-player-stats .player-nickname-title {
    max-width: 100%;
    font-size: 1.22rem;
    font-weight: 500;
    line-height: 1.25;
    text-align: center;
    color: #f7f8fa;
    word-break: break-word;
}

.modern-rating-summary {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 278px;
    margin: 0 0 18px;
    padding: 16px 14px 18px;
    text-align: center;
    background:
        radial-gradient(circle at 50% 58%, rgba(150, 27, 20, 0.24), transparent 33%),
        linear-gradient(145deg, rgba(11, 20, 31, 0.95), rgba(5, 13, 22, 0.96));
}

.modern-rating-kicker {
    color: #c5c9cf;
    font-size: 0.78rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.modern-rating-main {
    display: flex;
    flex-direction: column;
    align-items: center;
    order: 2;
}

.modern-rating-main strong {
    margin: 6px 0 8px;
    color: #e8bd46;
    font-size: 2.55rem;
    font-weight: 700;
    text-shadow: 0 0 20px rgba(255, 197, 28, 0.36);
}

.modern-rating-main span {
    order: 3;
    margin-top: 10px;
    color: #f3f4f6;
    font-size: 1rem;
    font-weight: 700;
}

.modern-rating-main small {
    order: 4;
    margin-top: 4px;
    color: #a7acb4;
    font-size: 0.78rem;
}

.modern-rank-caption {
    display: flex;
    flex-direction: column;
    align-items: center;
    order: 4;
}

.modern-rank-caption span {
    margin-top: 10px;
    color: #f3f4f6;
    font-size: 1rem;
    font-weight: 700;
}

.modern-rank-caption small {
    margin-top: 4px;
    color: #a7acb4;
    font-size: 0.78rem;
}

.modern-rating-rank {
    order: 3;
    width: 116px;
    height: 116px;
    margin: -4px 0 0;
    background: radial-gradient(circle at 50% 48%, rgba(255, 197, 28, 0.18), transparent 66%);
}

.modern-rating-rank img {
    filter:
        drop-shadow(0 14px 20px rgba(0, 0, 0, 0.42))
        drop-shadow(0 0 16px rgba(255, 197, 28, 0.22));
}

.modern-rating-delta {
    order: 5;
    margin-top: 8px;
    font-size: 0.8rem;
}

.modern-favorite-civ {
    margin-top: 16px;
    padding: 16px;
    border-radius: 0;
    border-width: 1px 0 0;
    background: transparent;
    box-shadow: none;
}

.modern-favorite-civ > span {
    color: #b8bec7;
    font-size: 0.78rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.modern-player-stats .player-stats-nav {
    gap: 8px;
    margin-top: 4px;
}

.modern-player-stats .stats-nav-button {
    min-height: 52px;
    padding: 0 18px;
    border-color: rgba(167, 116, 25, 0.28);
    border-radius: 7px;
    color: #b6bbc2;
    background: rgba(6, 14, 23, 0.54);
}

.modern-player-stats .stats-nav-button:hover,
.modern-player-stats .stats-nav-button.active {
    color: #ffc51c;
    border-color: rgba(255, 197, 28, 0.42);
    background:
        linear-gradient(90deg, rgba(255, 197, 28, 0.24), rgba(255, 197, 28, 0.04));
    box-shadow:
        inset 4px 0 0 #ffc51c,
        0 0 18px rgba(255, 197, 28, 0.12);
}

.modern-player-stats .player-stats-main {
    padding: 24px 28px 28px 0;
}

.modern-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    min-height: 42px;
    margin-bottom: 16px;
}

.modern-page-header h2 {
    margin: 0;
    color: #f5f6f8;
    font-size: 1.55rem;
    font-weight: 500;
    letter-spacing: 0;
}

.modern-page-header .rating-chart-zoom-controls {
    display: flex;
    gap: 8px;
}

.modern-player-stats .rating-zoom-btn {
    min-width: 78px;
    height: 40px;
    border: 1px solid rgba(80, 91, 105, 0.72);
    border-radius: 5px;
    background: rgba(7, 14, 23, 0.78);
    color: #f0f1f3;
    font-size: 0.95rem;
    font-weight: 600;
}

.modern-player-stats .rating-zoom-btn:hover,
.modern-player-stats .rating-zoom-btn.active {
    border-color: rgba(255, 197, 28, 0.78);
    color: #ffc51c;
    background:
        linear-gradient(180deg, rgba(255, 197, 28, 0.16), rgba(6, 13, 22, 0.88));
    box-shadow:
        inset 0 -2px 0 rgba(255, 197, 28, 0.7),
        0 0 16px rgba(255, 197, 28, 0.16);
}

.modern-player-stats .rating-chart-container {
    min-height: 342px;
    margin-bottom: 18px;
    padding: 24px 28px 20px;
    background:
        radial-gradient(circle at 82% 18%, rgba(146, 110, 23, 0.1), transparent 36%),
        linear-gradient(145deg, rgba(10, 20, 32, 0.94), rgba(5, 12, 21, 0.96));
}

.modern-player-stats .rating-chart-header {
    align-items: flex-start;
    margin-bottom: 14px;
}

.modern-player-stats .rating-chart-title {
    color: #c7ccd3;
    font-size: 0.98rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.modern-player-stats .chart-wrapper,
.modern-player-stats .rating-chart {
    height: 240px;
}

.modern-player-stats .player-main-stats {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.modern-player-stats .stat-card {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr);
    align-items: center;
    box-sizing: border-box;
    height: 100px;
    min-height: 100px;
    padding: 18px 20px;
    text-align: left;
    background:
        radial-gradient(circle at 18% 20%, rgba(255, 197, 28, 0.07), transparent 36%),
        linear-gradient(145deg, rgba(10, 20, 32, 0.94), rgba(5, 12, 21, 0.96));
}

.modern-stat-icon {
    display: grid;
    place-items: center;
    width: 50px;
    height: 50px;
    border: 1px solid rgba(255, 197, 28, 0.42);
    border-radius: 8px;
    color: #ffc51c;
    background:
        linear-gradient(145deg, rgba(255, 197, 28, 0.14), rgba(6, 13, 22, 0.84));
    box-shadow: 0 0 18px rgba(255, 197, 28, 0.12);
}

.modern-stat-icon svg {
    width: 27px;
    height: 27px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.modern-stat-copy {
    min-width: 0;
    padding-left: 16px;
}

.modern-player-stats .stat-label {
    margin: 0 0 4px;
    color: #b5bac2;
    font-size: 0.95rem;
    line-height: 1.25;
}

.modern-player-stats .stat-value {
    color: #f8f9fb;
    font-size: 1.62rem;
    font-weight: 500;
    line-height: 1.15;
}

.modern-player-stats .stat-value.rating-delta-positive {
    color: #ffc51c;
}

.modern-player-stats .stat-value.rating-delta-negative {
    color: #ff554d;
}

.modern-stat-progress {
    display: block;
    height: 4px;
    margin-top: 12px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.18);
}

.modern-stat-progress span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #ffc51c, #f2d670);
}

.modern-recent-table-card {
    padding: 16px 18px 18px;
}

.modern-card-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 10px;
}

.modern-card-heading h3 {
    margin: 0;
    color: #f3f4f6;
    font-size: 1.02rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.modern-card-heading .modern-card-action {
    width: auto;
    min-width: 194px;
    min-height: 40px;
    margin: 0;
    padding: 0 18px;
    border-color: rgba(80, 91, 105, 0.58);
    border-radius: 7px;
    color: #f0f1f3;
    font-weight: 500;
}

.modern-match-table {
    overflow: hidden;
}

.modern-table-head,
.modern-table-row {
    display: grid;
    grid-template-columns: minmax(240px, 1.6fr) minmax(126px, 0.7fr) minmax(130px, 0.7fr) minmax(170px, 0.75fr);
    align-items: center;
    column-gap: 18px;
}

.modern-table-head {
    min-height: 44px;
    padding: 0 18px;
    border: 1px solid rgba(165, 112, 22, 0.22);
    background:
        linear-gradient(180deg, rgba(18, 27, 38, 0.86), rgba(10, 18, 29, 0.88));
    color: #bfc4cb;
    font-size: 0.86rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.modern-table-row {
    min-height: 52px;
    padding: 0 18px;
    border-bottom: 1px solid rgba(66, 76, 89, 0.38);
    color: #c9ced5;
    font-size: 1rem;
}

.modern-table-civ {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.modern-table-civ span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.modern-table-row .match-civ-icon {
    width: 28px;
    height: 28px;
    border-radius: 4px;
    border-color: rgba(255, 197, 28, 0.36);
}

.modern-table-row .modern-match-result,
.modern-table-row .modern-rating-change {
    text-align: left;
    font-size: 0.96rem;
    font-weight: 500;
}

.modern-table-row .modern-rating-change {
    color: #ffc51c;
    font-size: 1.16rem;
    font-weight: 600;
}

.modern-table-row .modern-rating-change.negative {
    color: #ff554d;
}

@media (max-width: 1280px) {
    .modern-player-stats .player-main-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .modern-player-stats .stat-card:last-child {
        grid-column: span 2;
    }
}

@media (max-width: 980px) {
    .modern-player-stats {
        grid-template-columns: 1fr;
        background: #040a11;
    }

    .modern-player-stats .player-stats-sidebar {
        min-height: auto;
        border-width: 0 0 1px;
        border-radius: 10px 10px 0 0;
    }

    .modern-player-stats .player-stats-main {
        padding: 0 16px 18px;
    }

    .modern-page-header {
        align-items: stretch;
        flex-direction: column;
    }

    .modern-page-header .rating-chart-zoom-controls {
        overflow-x: auto;
        padding-bottom: 2px;
    }

    .modern-player-stats .rating-zoom-btn {
        min-width: 72px;
    }

    .modern-table-head,
    .modern-table-row {
        grid-template-columns: minmax(180px, 1fr) 104px 102px 92px;
        column-gap: 12px;
        padding-inline: 12px;
    }
}

@media (max-width: 640px) {
    .modern-player-stats .player-main-stats,
    .modern-player-stats .stat-card:last-child {
        grid-template-columns: 1fr;
        grid-column: auto;
    }

    .modern-player-stats .stat-card {
        grid-template-columns: 46px minmax(0, 1fr);
        padding: 14px;
    }

    .modern-stat-icon {
        width: 44px;
        height: 44px;
    }

    .modern-card-heading {
        align-items: stretch;
        flex-direction: column;
    }

    .modern-card-heading .modern-card-action {
        width: 100%;
        min-width: 0;
    }

    .modern-match-table {
        overflow-x: auto;
    }

    .modern-table-head,
    .modern-table-row {
        min-width: 640px;
    }
}

/* Concept player stats layout */
body #player-stats-modal .modal-content.wide-modal {
    width: min(1200px, calc(100vw - 24px)) !important;
    max-width: 1200px !important;
    max-height: calc(100vh - 24px) !important;
    margin: 12px auto !important;
    padding: 0 !important;
    overflow: hidden !important;
    border: 1px solid rgba(33, 49, 66, 0.95) !important;
    border-radius: 12px !important;
    background: rgb(2, 10, 17) !important;
    box-shadow:
        0 28px 80px rgba(0, 0, 0, 0.64),
        inset 0 1px 0 rgba(255, 230, 155, 0.08) !important;
    transform: none !important;
}

body #player-stats-modal .close {
    top: 10px;
    right: 12px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    color: rgba(255, 230, 155, 0.92);
    background: rgba(9, 16, 26, 0.72);
    border: 1px solid rgba(78, 94, 116, 0.48);
    font-size: 22px;
    line-height: 25px;
    text-align: center;
}

body #player-stats-modal .close:hover {
    color: #fff7d6;
    border-color: rgba(255, 213, 111, 0.58);
    background: rgba(255, 213, 111, 0.12);
}

#player-stats-content {
    width: 100%;
    min-height: 0;
    min-width: 0;
}

.concept-player-stats,
.concept-player-stats * {
    box-sizing: border-box;
}

.concept-player-stats.player-stats-container,
.concept-player-stats.modern-player-stats {
    --concept-yellow: rgb(244, 198, 96);
    --concept-yellow-rgb: 244, 198, 96;
    display: flex;
    flex-direction: column;
    width: 100% !important;
    height: 100%;
    max-width: 1200px !important;
    max-height: none;
    min-height: 0;
    padding: 12px 14px 14px;
    overflow-x: hidden;
    overflow-y: hidden;
    color: #e7edf5;
    background: rgb(2, 10, 17);
    border: 0 !important;
    border-radius: 12px;
    box-shadow: none !important;
    font-family: "Roboto", "Inter", sans-serif;
    font-size: 14px;
    line-height: 1.35;
}

.concept-player-stats h1,
.concept-player-stats h2,
.concept-player-stats h3,
.concept-player-stats h4 {
    text-shadow: none !important;
}

.concept-player-stats .player-info-header,
.concept-player-stats .rating-chart-container,
.concept-player-stats .recent-matches-section,
.concept-player-stats .modern-list-card,
.concept-footer-stat {
    border: 1px solid rgba(45, 62, 82, 0.86);
    border-radius: 8px;
    background:
        linear-gradient(180deg, rgba(9, 19, 25, 0.96), rgba(3, 12, 17, 0.98));
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.045),
        0 12px 24px rgba(0, 0, 0, 0.18);
}

.concept-player-stats .player-info-header {
    position: static;
    top: auto;
    z-index: auto;
    min-height: 0;
    height: auto;
    margin: 0 0 2px;
    padding: 4px 12px;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    backdrop-filter: none;
}

.concept-player-header .player-title-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: nowrap;
    min-height: 53px;
}

.concept-player-header .player-stats-title-block {
    display: flex;
    flex-direction: row;
    align-items: center;
    flex: 1 1 auto;
    min-width: 0 !important;
    gap: 12px;
}

.concept-player-stats .player-stats-avatar-frame {
    width: 53px !important;
    height: 53px !important;
    flex: 0 0 53px !important;
    flex-basis: 53px !important;
    border-color: rgba(var(--concept-yellow-rgb), 0.88);
    box-shadow:
        0 0 0 2px rgba(255, 213, 111, 0.12),
        0 12px 24px rgba(0, 0, 0, 0.46);
}

.concept-player-stats .player-nickname-title {
    flex: 0 1 auto;
    min-width: 0 !important;
    margin: 0;
    color: #f0f4fa;
    font-size: 22px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.015em;
    text-align: left;
    text-shadow: none;
    word-break: break-word;
}

.concept-player-stats .concept-player-header {
    flex: 0 0 auto;
    min-height: 0 !important;
    max-height: 65px;
    padding-block: 4px !important;
    overflow: visible;
    background: transparent !important;
}

.concept-player-stats .nickname-highlight {
    color: var(--concept-yellow);
    text-shadow: none;
}

.concept-player-stats .comparison-container {
    flex: 0 1 420px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    margin: 0 32px 0 0;
}

.concept-player-stats .comparison-search-input {
    width: min(300px, 100%);
    min-height: 38px;
    border-radius: 8px;
    border-color: rgba(52, 70, 91, 0.9);
    background: rgba(7, 17, 29, 0.72);
    color: #e9eef5;
    font-size: 0.88rem;
}

.concept-player-stats .compare-action-btn {
    min-width: 112px;
    min-height: 38px;
    border-radius: 8px;
    background: linear-gradient(180deg, #d8b25e, #a77b2e);
    color: #18202a;
    box-shadow: none;
}

.concept-player-stats .compare-action-btn:hover:not(:disabled) {
    background: linear-gradient(180deg, #e2bf70, #b38b3e);
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(214, 189, 114, 0.18);
}

.concept-player-stats .concept-player-tabs {
    flex: 0 0 auto;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0;
    min-height: 46px;
    margin: -6px 0 3px;
    overflow: hidden;
    border: 1px solid rgba(154, 166, 181, 0.07);
    border-radius: 8px;
    background: rgba(5, 13, 22, 0.36);
}

.concept-player-tabs .stats-nav-button {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
    min-height: 44px;
    padding: 0 14px;
    border: 0;
    border-right: 1px solid rgba(154, 166, 181, 0.045);
    border-radius: 0;
    background: transparent;
    color: #aab3bf;
    font-size: 0.9rem;
    font-weight: 700;
    text-align: center;
}

.concept-player-tabs .stats-nav-button:last-child {
    border-right: 0;
}

.concept-player-tabs .stats-nav-button:hover,
.concept-player-tabs .stats-nav-button.active {
    color: var(--concept-yellow);
    border-color: rgba(154, 166, 181, 0.045);
    background: transparent;
    box-shadow: none;
}

.concept-player-tabs .stats-nav-button.active {
    border-bottom: 0;
    background: radial-gradient(
        ellipse 72% 135% at 50% 100%,
        rgba(var(--concept-yellow-rgb), 0.17) 0%,
        rgba(var(--concept-yellow-rgb), 0.075) 38%,
        transparent 72%
    );
    box-shadow: inset 0 -12px 22px rgba(var(--concept-yellow-rgb), 0.035);
    text-shadow: 0 0 10px rgba(var(--concept-yellow-rgb), 0.22);
}

.concept-player-tabs .stats-nav-button.active .concept-ui-icon {
    filter: drop-shadow(0 0 5px rgba(var(--concept-yellow-rgb), 0.34));
}

.concept-player-tabs .stats-nav-button.active::after {
    content: '';
    position: absolute;
    right: 7%;
    bottom: 0;
    left: 7%;
    height: 1.5px;
    pointer-events: none;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(var(--concept-yellow-rgb), 0.46) 12%,
        rgba(var(--concept-yellow-rgb), 0.96) 36%,
        rgb(var(--concept-yellow-rgb)) 50%,
        rgba(var(--concept-yellow-rgb), 0.96) 64%,
        rgba(var(--concept-yellow-rgb), 0.46) 88%,
        transparent 100%
    );
    box-shadow: 0 0 8px rgba(var(--concept-yellow-rgb), 0.52);
}

.concept-player-stats .concept-ui-icon {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
    opacity: 0.9;
}

.concept-player-main {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 0 !important;
    padding-top: 0 !important;
    scrollbar-color: transparent transparent;
    scrollbar-width: thin;
}

.concept-player-main::-webkit-scrollbar {
    width: 7px;
}

.concept-player-main::-webkit-scrollbar-track {
    background: transparent;
    transition: background-color 450ms ease;
}

.concept-player-main::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: transparent;
    transition: background-color 450ms ease;
}

.concept-player-main.is-scrolling {
    scrollbar-color: rgba(121, 143, 166, 0.5) rgba(5, 13, 22, 0.24);
}

.concept-player-main.is-scrolling::-webkit-scrollbar-track {
    background: rgba(5, 13, 22, 0.24);
}

.concept-player-main.is-scrolling::-webkit-scrollbar-thumb {
    background: rgba(121, 143, 166, 0.5);
}

.concept-overview-layout {
    display: block;
    margin-bottom: 12px;
}

.concept-player-stats .concept-rating-card {
    min-height: 293px;
    margin: 0;
    padding: 18px 20px 16px;
    overflow: hidden;
    background:
        linear-gradient(180deg, rgba(5, 14, 21, 0.88), rgba(3, 11, 16, 0.94)),
        url('/static/aoe-back-optimized.webp') center/cover no-repeat;
}

.concept-player-stats .rating-chart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.concept-player-stats .rating-chart-title {
    margin: 0;
    color: #eef4fb;
    font-family: "Roboto", "Inter", sans-serif;
    font-size: 19px;
    font-weight: 700;
    letter-spacing: -0.01em;
    text-align: left;
    text-transform: none;
}

.concept-player-stats .rating-chart-zoom-controls {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
}

.concept-player-stats .rating-zoom-btn {
    display: inline-grid;
    place-items: center;
    box-sizing: border-box;
    width: 44px;
    min-width: 44px;
    height: 34px;
    padding: 0;
    border: 1px solid rgba(43, 64, 84, 0.92);
    border-radius: 10px;
    background: rgba(6, 17, 29, 0.82);
    color: #dce4ee;
    font-size: 1.12rem;
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
    transition: color 160ms ease, border-color 160ms ease, background-color 160ms ease;
}

.concept-player-stats .rating-zoom-btn:hover:not(:disabled) {
    color: var(--concept-yellow);
    border-color: rgba(var(--concept-yellow-rgb), 0.62);
    background: rgba(var(--concept-yellow-rgb), 0.12);
}

.concept-player-stats .rating-zoom-btn:disabled {
    color: #788695;
    cursor: default;
    opacity: 0.62;
}

.concept-player-stats .rating-zoom-value {
    display: inline-grid;
    place-items: center;
    box-sizing: border-box;
    width: 44px;
    min-width: 44px;
    height: 34px;
    padding: 0 8px;
    border: 1px solid rgba(var(--concept-yellow-rgb), 0.62);
    border-radius: 10px;
    background: rgba(8, 19, 31, 0.84);
    color: var(--concept-yellow);
    font-size: 0.86rem;
    font-weight: 800;
    line-height: 1;
    text-align: center;
    box-shadow: inset 0 0 12px rgba(var(--concept-yellow-rgb), 0.04);
}

.concept-player-stats .chart-wrapper,
.concept-player-stats .rating-chart {
    height: 230px;
}

.concept-recent-section .recent-matches-title,
.concept-full-matches .modern-card-heading h3 {
    margin: 0 0 10px;
    color: #eef4fb;
    font-family: "Roboto", "Inter", sans-serif;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.01em;
    text-align: left;
    text-transform: none;
}

.concept-footer-stat strong.win-rate-high {
    color: #61df78;
}

.concept-footer-stat strong.win-rate-medium {
    color: var(--concept-yellow);
}

.concept-footer-stat strong.win-rate-low {
    color: #ff6961;
}

.concept-recent-section {
    margin: 0 0 12px;
    padding: 14px 16px;
    font-family: "Roboto", "Inter", sans-serif;
}

.concept-recent-section .recent-matches-header {
    margin-bottom: 10px;
}

.concept-recent-section .recent-matches-title-wrapper {
    align-items: center;
    justify-content: space-between;
}

.concept-recent-section .recent-matches-title {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
}

.concept-recent-section .info-icon {
    width: 15px;
    height: 15px;
    font-size: 0.68rem;
    color: #d3bd75;
    border-color: rgba(211, 189, 117, 0.25);
    background: rgba(211, 189, 117, 0.12);
}

.concept-recent-section .recent-matches-dots {
    gap: 6px;
}

.concept-recent-section .match-dot {
    width: 12px;
    height: 12px;
}

.concept-match-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
}

.concept-match-card {
    min-width: 0;
    min-height: 144px;
    padding: 10px;
    border: 1px solid rgba(48, 66, 88, 0.84);
    border-left-width: 2px;
    border-radius: 7px;
    background:
        linear-gradient(180deg, rgba(14, 28, 43, 0.86), rgba(7, 17, 29, 0.9));
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.04),
        0 8px 18px rgba(0, 0, 0, 0.2);
}

.concept-match-card.win {
    border-left-color: #34b662;
}

.concept-match-card.loss {
    border-left-color: #d94252;
}

.concept-match-card:hover {
    transform: translateY(-1px);
    border-color: rgba(var(--concept-yellow-rgb), 0.34);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.05),
        0 12px 22px rgba(0, 0, 0, 0.24);
}

.concept-match-card .match-header {
    align-items: flex-start;
    min-height: 28px;
    margin-bottom: 6px;
}

.concept-match-card .match-map {
    color: #eef4fb;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.01em;
}

.concept-match-card .rating-change-badge {
    width: 24px;
    height: 24px;
    font-size: 0.68rem;
    border-width: 1px;
}

.concept-match-card .match-rating-delta {
    min-height: 24px;
    margin: 0 0 8px;
    padding: 0 8px;
    border-radius: 5px;
    font-size: 12px;
    font-weight: 400;
}

.concept-match-card .match-rating-delta .delta-label {
    overflow: hidden;
    color: rgba(227, 235, 245, 0.76);
    font-weight: 400;
    letter-spacing: 0;
    text-transform: none;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.concept-match-card .match-rating-delta .delta-value {
    flex: 0 0 auto;
    color: var(--concept-yellow);
    font-size: 13px;
    font-weight: 700;
}

.concept-match-card .match-content {
    gap: 5px;
}

.concept-match-card .match-civ-date {
    min-height: 20px;
}

.concept-match-card .match-civ-icon {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border-color: rgba(var(--concept-yellow-rgb), 0.22);
}

.concept-match-card .match-date {
    color: #aab5c3;
    font-size: 12px;
    font-weight: 400;
}

.concept-match-card .match-team {
    min-height: 22px;
    gap: 6px;
    padding: 0 7px;
    border-color: rgba(49, 66, 88, 0.72);
    background: rgba(7, 18, 31, 0.64);
}

.concept-match-card .match-team-label {
    flex: 0 0 auto;
    color: #aeb8c5;
    font-size: 10px;
    font-weight: 400;
    letter-spacing: 0.025em;
    text-transform: uppercase;
}

.concept-match-card .match-team-preview {
    min-width: 0;
    overflow: hidden;
    color: #dfe6ef;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: -0.005em;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.concept-footer-stats {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 8px;
    font-family: "Roboto", "Inter", sans-serif;
}

.concept-footer-stat {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 0;
    min-height: 62px;
    padding: 8px 8px 8px 36px;
    text-align: center;
}

.concept-footer-stat .concept-ui-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    width: 20px;
    height: 20px;
    color: rgba(var(--concept-yellow-rgb), 0.88);
    transform: translateY(-50%);
}

.concept-footer-stat strong {
    display: block;
    color: var(--concept-yellow);
    font-size: 20px;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.015em;
}

.concept-footer-stat span {
    display: block;
    max-width: 100%;
    margin-top: 5px;
    overflow: hidden;
    color: #c3cbd6;
    font-size: 11px;
    font-weight: 400;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.concept-player-stats .modern-section-grid,
.concept-player-stats .modern-section-grid.three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.concept-player-stats .modern-list-card {
    min-width: 0;
    padding: 16px;
}

.concept-player-stats .modern-mini-row,
.concept-player-stats .modern-match-row,
.concept-player-stats .modern-empty-row {
    min-height: 42px;
}

.concept-player-stats .modern-favorite-civ {
    margin-top: 0;
    padding: 16px;
}

.concept-full-matches .modern-card-heading {
    margin-bottom: 12px;
}

.concept-full-matches .modern-match-row {
    grid-template-columns: minmax(0, 1fr) 104px 108px 76px 76px;
}

.concept-full-matches .modern-match-main small {
    display: none;
}

.concept-full-matches .modern-match-date {
    justify-self: end;
    color: #aeb8c5;
    white-space: nowrap;
}

/* Player relations dashboard */
.player-relations-dashboard {
    display: flex;
    flex-direction: column;
    width: 100%;
    min-width: 0;
    gap: 14px;
}

.player-relations-row {
    display: grid;
    min-width: 0;
    gap: 14px;
}

.player-relations-top {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.player-relations-bottom {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.player-relation-card {
    --relation-accent: rgb(244, 198, 96);
    --relation-accent-rgb: 244, 198, 96;
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 12px 12px 11px;
    overflow: hidden;
    border: 1px solid rgba(92, 112, 134, 0.3);
    border-radius: 9px;
    background:
        radial-gradient(circle at 0 0, rgba(var(--relation-accent-rgb), 0.055), transparent 32%),
        linear-gradient(145deg, rgba(7, 19, 31, 0.92), rgba(3, 12, 21, 0.97));
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.025),
        0 12px 26px rgba(0, 0, 0, 0.16);
    font-family: "Roboto", "Inter", sans-serif;
}

.player-relation-card.is-success {
    --relation-accent: #55c96a;
    --relation-accent-rgb: 85, 201, 106;
}

.player-relation-card.is-danger {
    --relation-accent: #ef4f4f;
    --relation-accent-rgb: 239, 79, 79;
}

.concept-player-stats header.player-relation-header {
    position: static;
    z-index: auto;
    display: flex;
    align-items: center;
    min-height: 43px !important;
    gap: 11px;
    margin: 0 !important;
    padding: 0 7px 7px !important;
    overflow: visible;
    border: 0;
    background: transparent;
    box-shadow: none;
    text-align: left;
}

.player-relation-header h3 {
    min-width: 0;
    margin: 0 !important;
    color: rgb(246, 244, 245);
    font-family: "Roboto", "Inter", sans-serif !important;
    font-size: 18px !important;
    font-weight: 500 !important;
    line-height: 1.2 !important;
    letter-spacing: -0.015em !important;
    text-align: left !important;
    text-shadow: none !important;
}

.player-relation-icon {
    display: inline-grid;
    place-items: center;
    flex: 0 0 29px;
    width: 29px;
    height: 29px;
    color: var(--relation-accent);
}

.player-relation-icon-svg {
    width: 27px;
    height: 27px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.player-relation-columns,
.player-relation-row {
    display: grid;
    align-items: center;
    min-width: 0;
}

.player-relation-columns {
    min-height: 25px;
    padding: 0 10px 3px;
    color: #9ea9b6;
    font-size: 12px;
    font-weight: 400;
}

.player-relation-columns.is-percent,
.player-relation-row.is-percent {
    grid-template-columns: 28px minmax(0, 1fr) minmax(76px, 112px) 72px;
    gap: 8px;
}

.player-relation-columns.is-score,
.player-relation-row.is-score {
    grid-template-columns: 28px minmax(0, 1fr) auto;
    gap: 9px;
}

.player-relation-columns.is-score.without-rank,
.player-relation-row.is-score.without-rank {
    grid-template-columns: minmax(0, 1fr) auto;
}

.player-relation-columns span:last-child {
    justify-self: end;
}

.player-relation-list {
    min-width: 0;
}

.player-relation-row {
    min-height: 41px;
    margin-bottom: 3px;
    padding: 5px 9px;
    overflow: hidden;
    border: 1px solid rgba(74, 96, 119, 0.22);
    border-radius: 7px;
    background: linear-gradient(90deg, rgba(8, 21, 34, 0.88), rgba(5, 16, 27, 0.78));
    color: #e7ebf0;
    font-size: 14px;
    transition: border-color 150ms ease, background 150ms ease;
}

.player-relation-row:hover {
    border-color: rgba(var(--relation-accent-rgb), 0.22);
    background: linear-gradient(90deg, rgba(var(--relation-accent-rgb), 0.045), rgba(6, 17, 28, 0.88));
}

.player-relation-rank {
    color: #e1e6ed;
    font-variant-numeric: tabular-nums;
}

.player-relation-name {
    min-width: 0;
    overflow: hidden;
    color: #e8ebef;
    font-weight: 400;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.player-relation-progress {
    display: block;
    height: 6px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(58, 84, 108, 0.2);
}

.player-relation-progress > span {
    display: block;
    width: var(--relation-progress);
    height: 100%;
    border-radius: inherit;
    background: #55c96a;
}

.player-relation-progress.is-warning > span {
    background: rgb(244, 198, 96);
}

.player-relation-winrate {
    justify-self: end;
    min-width: 66px;
    padding: 4px 7px;
    border-radius: 5px;
    color: #58d36d;
    background: rgba(55, 178, 79, 0.12);
    font-size: 15px;
    font-weight: 600;
    line-height: 1.1;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.player-relation-winrate.is-warning {
    color: rgb(244, 198, 96);
    background: rgba(244, 198, 96, 0.11);
}

.player-relation-score {
    justify-self: end;
    min-width: 54px;
    font-size: 15px;
    font-weight: 600;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.player-relation-score.is-success {
    color: #59d46f;
}

.player-relation-score.is-danger {
    color: #ff5353;
}

.player-relation-extra {
    display: none;
}

.player-relation-card.is-expanded .player-relation-extra {
    display: block;
}

.player-relation-expand {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 38px;
    gap: 8px;
    margin-top: 7px;
    padding: 0 13px;
    border: 1px solid rgba(92, 112, 134, 0.3);
    border-radius: 7px;
    color: #d2d7dd;
    background: rgba(3, 12, 21, 0.42);
    font: inherit;
    font-size: 14px;
    font-weight: 400;
    cursor: pointer;
    transition: border-color 150ms ease, color 150ms ease, background 150ms ease;
}

.player-relation-expand:hover {
    color: #f3f5f7;
    border-color: rgba(var(--relation-accent-rgb), 0.28);
    background: rgba(var(--relation-accent-rgb), 0.05);
}

.player-relation-expand svg {
    width: 17px;
    height: 17px;
    margin-left: auto;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform 160ms ease;
}

.player-relation-card.is-expanded .player-relation-expand svg {
    transform: rotate(90deg);
}

.player-relation-empty {
    display: grid;
    place-items: center;
    min-height: 202px;
    color: #8794a2;
    font-size: 13px;
}

/* Civilization dashboard */
.civilizations-dashboard {
    display: grid;
    gap: 14px;
    width: 100%;
    min-width: 0;
}

.civilizations-dashboard-top,
.civilizations-dashboard-bottom {
    display: grid;
    min-width: 0;
    gap: 14px;
}

.civilizations-dashboard-top {
    grid-template-columns: minmax(0, 1.22fr) minmax(390px, 0.98fr);
    align-items: start;
}

.civ-card-popular,
.civ-best-card {
    height: 290px;
}

.civilizations-dashboard-bottom {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.civ-stats-card,
.civ-best-card {
    --civ-accent: #54bf6a;
    --civ-accent-rgb: 84, 191, 106;
    font-family: "Inter", sans-serif;
    font-weight: 500;
    position: relative;
    min-width: 0;
    overflow: hidden;
    border: 1px solid rgba(var(--civ-accent-rgb), 0.58);
    border-radius: 9px;
    background:
        radial-gradient(circle at 0 0, rgba(var(--civ-accent-rgb), 0.1), transparent 33%),
        linear-gradient(135deg, rgba(10, 24, 32, 0.97), rgba(5, 14, 23, 0.98));
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.04),
        0 14px 32px rgba(0, 0, 0, 0.2);
}

.civ-card-danger {
    --civ-accent: #e55357;
    --civ-accent-rgb: 229, 83, 87;
}

.civ-card-popular {
    --civ-accent: #328ee8;
    --civ-accent-rgb: 50, 142, 232;
}

.civ-best-card {
    --civ-accent: rgb(244, 198, 96);
    --civ-accent-rgb: 244, 198, 96;
    background:
        radial-gradient(circle at 32% 56%, rgba(226, 174, 48, 0.19), transparent 33%),
        radial-gradient(circle at 100% 0, rgba(232, 185, 71, 0.07), transparent 32%),
        linear-gradient(135deg, rgba(25, 23, 16, 0.97), rgba(5, 14, 22, 0.99) 74%);
}

.civ-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 68px;
    padding: 14px 18px 10px;
}

/* The site shell has a global header rule; neutralize it inside dashboard cards. */
.concept-player-stats header.civ-card-header {
    position: static;
    z-index: auto;
    min-height: 68px !important;
    margin: 0 !important;
    padding: 14px 18px 10px !important;
    overflow: visible;
    border: 0;
    text-align: left;
}

.civ-card-header > div {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    min-width: 0;
    gap: 2px;
    text-align: left;
}

.civ-card-icon {
    display: grid;
    place-items: center;
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
    color: var(--civ-accent);
    border: 1px solid rgba(var(--civ-accent-rgb), 0.2);
    border-radius: 50%;
    background: rgba(var(--civ-accent-rgb), 0.09);
}

.civ-panel-icon {
    width: 23px;
    height: 23px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.civ-panel-laurel {
    display: block;
    width: 29px;
    height: 28px;
    background-color: currentColor;
    -webkit-mask: url('/static/image/laurel_branches.svg') center / contain no-repeat;
    mask: url('/static/image/laurel_branches.svg') center / contain no-repeat;
    filter: drop-shadow(0 0 5px rgba(var(--civ-accent-rgb), 0.28));
}

.civ-card-header h3 {
    width: auto;
    margin: 0 !important;
    color: rgb(246, 242, 244);
    font-family: "Roboto", "Inter", sans-serif !important;
    font-size: 20px !important;
    font-weight: 500 !important;
    line-height: 1.2 !important;
    letter-spacing: -0.02em !important;
    text-align: left !important;
    text-shadow: none !important;
}

.concept-player-stats .civ-card-popular .civ-card-header h3,
.concept-player-stats .civ-card-success .civ-card-header h3,
.concept-player-stats .civ-card-danger .civ-card-header h3 {
    color: rgb(250, 248, 249) !important;
}

.civ-card-header p {
    width: auto;
    margin: 0 !important;
    color: #99a4b2;
    font-family: "Roboto", "Inter", sans-serif;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.2;
    text-align: left !important;
    text-shadow: none !important;
}

.civ-best-card .civ-card-header h3 {
    color: rgb(244, 198, 96) !important;
}

.civ-table-head,
.civ-stat-row {
    display: grid;
    grid-template-columns: 30px minmax(130px, 1.25fr) minmax(92px, 0.72fr) minmax(110px, 1fr) 72px;
    align-items: center;
    column-gap: 10px;
}

.civ-table-head {
    min-height: 28px;
    margin: 0 14px;
    padding: 0 10px;
    color: #929da9;
    font-size: 0.68rem;
    border-radius: 6px 6px 0 0;
    background: rgba(255, 255, 255, 0.022);
}

.civ-table-head span:last-child {
    text-align: right;
}

.civ-stats-list {
    margin: 0 14px 12px;
    overflow: hidden;
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.018);
}

.civ-stat-row {
    min-height: 41px;
    padding: 5px 10px;
    border-bottom: 1px solid rgba(128, 151, 174, 0.1);
    background: linear-gradient(90deg, rgba(var(--civ-accent-rgb), 0.025), rgba(255, 255, 255, 0.008));
}

.civ-stat-row:last-child {
    border-bottom: 0;
}

.civ-rank {
    display: inline-grid;
    place-items: center;
    width: 24px;
    min-height: 25px;
    justify-self: center;
    color: #b6c0ca;
    font-size: 0.76rem;
    font-weight: 800;
    border: 1px solid transparent;
    border-radius: 8px;
}

.civ-rank.rank-1,
.civ-rank.rank-2,
.civ-rank.rank-3 {
    color: #fff7d4;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.civ-rank.rank-1 {
    border-color: rgba(255, 212, 102, 0.5);
    background: linear-gradient(180deg, rgba(217, 167, 54, 0.72), rgba(111, 77, 19, 0.74));
}

.civ-rank.rank-2 {
    border-color: rgba(205, 216, 225, 0.42);
    background: linear-gradient(180deg, rgba(145, 158, 169, 0.68), rgba(65, 75, 85, 0.76));
}

.civ-rank.rank-3 {
    border-color: rgba(207, 132, 87, 0.45);
    background: linear-gradient(180deg, rgba(153, 83, 46, 0.72), rgba(76, 40, 25, 0.78));
}

.civ-row-identity {
    display: flex;
    align-items: center;
    min-width: 0;
    gap: 10px;
}

.civ-row-identity .civilization-icon {
    width: 27px;
    height: 27px;
    border-radius: 50%;
    border-color: rgba(232, 194, 95, 0.25);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.35);
}

.civ-row-identity > span {
    min-width: 0;
    overflow: hidden;
    color: #edf2f7;
    font-size: 0.84rem;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.civ-row-detail {
    color: #aab3bf;
    font-size: 0.75rem;
    white-space: nowrap;
}

.civ-row-bar {
    display: block;
    height: 6px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(var(--civ-accent-rgb), 0.08);
}

.civ-row-bar > span {
    display: block;
    width: var(--civ-bar-width);
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, rgba(var(--civ-accent-rgb), 0.7), var(--civ-accent));
    box-shadow: 0 0 10px rgba(var(--civ-accent-rgb), 0.3);
}

.civ-winrate {
    min-width: 0;
    justify-self: end;
    padding: 3px 8px;
    color: var(--civ-accent);
    font-size: 0.9rem;
    font-weight: 900;
    line-height: 1.2;
    border-radius: 5px;
    background: rgba(var(--civ-accent-rgb), 0.12);
}

.civ-card-popular .civ-winrate--low {
    color: #ff6464;
    background: rgba(255, 82, 82, 0.14);
}

.civ-card-popular .civ-winrate--mid {
    color: rgb(244, 198, 96);
    background: rgba(244, 198, 96, 0.14);
}

.civ-card-popular .civ-winrate--high {
    color: #65d879;
    background: rgba(84, 191, 106, 0.14);
}

.civ-extra-rows {
    display: none;
}

.civ-stats-card.is-expanded .civ-extra-rows {
    display: block;
}

.civ-expand-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: calc(100% - 28px);
    min-height: 40px;
    gap: 10px;
    margin: -3px 14px 12px;
    border: 1px solid rgba(var(--civ-accent-rgb), 0.62);
    border-radius: 7px;
    background: rgba(var(--civ-accent-rgb), 0.025);
    color: var(--civ-accent);
    font-size: 0.78rem;
    font-weight: 750;
}

.civ-expand-button:hover {
    background: rgba(var(--civ-accent-rgb), 0.1);
    box-shadow: inset 0 0 18px rgba(var(--civ-accent-rgb), 0.04);
}

.civ-expand-chevron {
    display: inline-grid;
    place-items: center;
    width: 18px;
    height: 18px;
    color: #fff;
    transition: transform 160ms ease;
}

.civ-expand-chevron svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.civ-stats-card.is-expanded .civ-expand-chevron {
    transform: rotate(180deg);
}

.civ-stats-empty {
    display: grid;
    place-items: center;
    min-height: 180px;
    margin: 0 14px 14px;
    color: #8f9aa7;
    border: 1px dashed rgba(var(--civ-accent-rgb), 0.2);
    border-radius: 7px;
    background: rgba(0, 0, 0, 0.08);
}

.civ-best-content {
    display: grid;
    grid-template-columns: minmax(238px, 1.12fr) minmax(160px, 0.88fr);
    align-items: center;
    height: 220px;
    min-height: 0;
    padding: 0 18px 10px;
}

.civ-best-emblem {
    position: relative;
    display: grid;
    place-items: center;
    min-width: 0;
    height: 210px;
    min-height: 0;
    overflow: hidden;
}

.civ-best-emblem::before,
.civ-best-emblem::after {
    content: '';
    position: absolute;
    left: 50%;
    border-radius: 50%;
    transform: translateX(-50%);
}

.civ-best-emblem::before {
    bottom: 24px;
    width: min(260px, 92%);
    height: 38px;
    border: 2px solid rgba(244, 193, 62, 0.72);
    box-shadow:
        0 0 10px rgba(244, 193, 62, 0.7),
        0 0 34px rgba(244, 193, 62, 0.36),
        inset 0 0 15px rgba(244, 193, 62, 0.2);
}

.civ-best-emblem::after {
    bottom: 13px;
    width: min(300px, 100%);
    height: 38px;
    border-bottom: 2px solid rgba(212, 157, 38, 0.38);
    background: radial-gradient(ellipse, rgba(239, 185, 52, 0.19), transparent 68%);
}

.civ-best-aura {
    position: absolute;
    inset: 8% 10% 10%;
    background:
        linear-gradient(82deg, transparent 35%, rgba(255, 219, 112, 0.18) 48%, transparent 58%),
        linear-gradient(98deg, transparent 37%, rgba(255, 204, 72, 0.15) 50%, transparent 61%);
    filter: blur(5px);
}

.civ-best-emblem .civilization-icon {
    z-index: 1;
    width: 178px;
    height: 205px;
    margin-bottom: 0;
    border: 5px solid #d9aa3c;
    border-radius: 0;
    clip-path: polygon(7% 4%, 93% 4%, 93% 66%, 83% 84%, 50% 100%, 17% 84%, 7% 66%);
    background: #1a1f24;
    box-shadow: none;
    filter:
        drop-shadow(0 0 8px rgba(245, 197, 70, 0.78))
        drop-shadow(0 16px 15px rgba(0, 0, 0, 0.6));
    transform: scale(3);
    transform-origin: center;
}

.civ-best-emblem .civilization-icon img {
    border-radius: 0;
}

.concept-player-stats .civ-best-emblem .civilization-icon:not(.fallback):hover {
    box-shadow: none;
    transform: scale(3);
}

.concept-player-stats .civ-best-emblem .civilization-icon:not(.fallback):hover img {
    transform: none;
}

.civ-best-summary {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-width: 0;
    min-height: 0;
    padding: 0 0 0 20px;
    border-left: 1px solid rgba(232, 185, 71, 0.34);
}

.civ-best-name {
    max-width: 100%;
    margin-bottom: 12px;
    overflow: hidden;
    color: #f6f7f9;
    font-size: clamp(1.5rem, 2vw, 2.15rem);
    font-weight: 850;
    line-height: 1.1;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.civ-best-label {
    color: #9ba5b0;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.civ-best-rate {
    margin-top: 3px;
    color: #5ecb6e;
    font-size: clamp(2rem, 3vw, 2.8rem);
    font-weight: 900;
    line-height: 1.05;
    text-shadow: 0 0 18px rgba(94, 203, 110, 0.17);
}

.civ-best-separator {
    width: 100%;
    height: 1px;
    margin: 9px 0 10px;
    background: linear-gradient(90deg, rgba(232, 185, 71, 0.45), transparent);
}

.civ-best-wins {
    margin-top: 3px;
    color: #f0f3f7;
    font-size: 1.8rem;
    font-weight: 800;
    line-height: 1.1;
}

@media (max-width: 1080px) {
    .concept-overview-layout {
        grid-template-columns: minmax(0, 1fr) 286px;
    }

    .concept-match-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .concept-footer-stats {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .concept-player-stats .modern-section-grid,
    .concept-player-stats .modern-section-grid.three {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .player-relations-top {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .player-relations-top .player-relation-card:last-child {
        grid-column: 1 / -1;
    }

    .civilizations-dashboard-top {
        grid-template-columns: 1fr;
    }

    .civ-best-content {
        min-height: 0;
    }
}

@media (max-width: 860px) {
    .concept-player-stats.player-stats-container,
    .concept-player-stats.modern-player-stats {
        padding: 10px;
    }

    .concept-player-header .player-title-wrapper {
        align-items: stretch;
        flex-direction: column;
    }

    .concept-player-stats .comparison-container {
        justify-content: stretch;
        flex: 1 1 auto;
        margin: 0;
    }

    .concept-player-stats .comparison-search-input {
        width: 100%;
    }

    .concept-player-tabs {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .concept-player-tabs .stats-nav-button:nth-child(2n) {
        border-right: 0;
    }

    .concept-player-tabs .stats-nav-button:nth-child(-n + 2) {
        border-bottom: 1px solid rgba(154, 166, 181, 0.045);
    }

    .concept-overview-layout {
        grid-template-columns: 1fr;
    }

    .concept-player-stats .concept-rating-card {
        min-height: 280px;
    }

    .concept-player-stats .chart-wrapper,
    .concept-player-stats .rating-chart {
        height: 210px;
    }

    .concept-match-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .concept-footer-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .player-relations-top,
    .player-relations-bottom {
        grid-template-columns: 1fr;
    }

    .player-relations-top .player-relation-card:last-child {
        grid-column: auto;
    }

    .civilizations-dashboard-bottom {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 560px) {
    body #player-stats-modal .modal-content.wide-modal {
        width: calc(100vw - 12px) !important;
        max-height: calc(100vh - 12px) !important;
        margin: 6px auto !important;
    }

    .concept-player-stats.player-stats-container,
    .concept-player-stats.modern-player-stats {
        max-height: calc(100vh - 12px);
        padding: 8px;
    }

    .concept-player-stats .player-info-header,
    .concept-player-stats .concept-rating-card,
    .concept-recent-section,
    .concept-player-stats .modern-list-card {
        padding: 12px;
    }

    .concept-player-stats .player-stats-title-block {
        align-items: flex-start;
    }

    .concept-player-stats .player-nickname-title {
        font-size: 0.98rem;
    }

    .concept-player-stats .comparison-container {
        flex-direction: column;
    }

    .concept-player-stats .compare-action-btn {
        width: 100%;
    }

    .player-relations-dashboard,
    .player-relations-row {
        gap: 10px;
    }

    .player-relation-card {
        padding: 10px;
    }

    .player-relation-columns.is-percent,
    .player-relation-row.is-percent {
        grid-template-columns: 24px minmax(0, 1fr) 68px;
        gap: 6px;
    }

    .player-relation-columns.is-percent > span:nth-child(3),
    .player-relation-row.is-percent > .player-relation-progress {
        display: none;
    }

    .concept-player-tabs {
        grid-template-columns: 1fr;
    }

    .concept-player-tabs .stats-nav-button {
        border-right: 0;
        border-bottom: 1px solid rgba(154, 166, 181, 0.045);
    }

    .concept-player-tabs .stats-nav-button:last-child {
        border-bottom: 0;
    }

    .concept-player-stats .rating-chart-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .concept-player-stats .chart-wrapper,
    .concept-player-stats .rating-chart {
        height: 190px;
    }

    .concept-match-grid,
    .concept-footer-stats,
    .concept-player-stats .modern-section-grid,
    .concept-player-stats .modern-section-grid.three {
        grid-template-columns: 1fr;
    }

    .concept-footer-stat span {
        white-space: normal;
    }

    .civilizations-dashboard {
        gap: 10px;
    }

    .civilizations-dashboard-top,
    .civilizations-dashboard-bottom {
        gap: 10px;
    }

    .concept-player-stats header.civ-card-header {
        padding-inline: 12px !important;
    }

    .civ-table-head,
    .civ-stat-row {
        grid-template-columns: 25px minmax(0, 1fr) 66px;
        column-gap: 7px;
    }

    .civ-table-head {
        margin-inline: 8px;
        padding-inline: 7px;
    }

    .civ-table-head span:nth-child(3),
    .civ-table-head span:nth-child(4),
    .civ-row-detail,
    .civ-row-bar {
        display: none;
    }

    .civ-table-head span:last-child {
        grid-column: 3;
    }

    .civ-stats-list {
        margin-inline: 8px;
    }

    .civ-stat-row {
        padding-inline: 7px;
    }

    .civ-row-identity > span {
        font-size: 0.78rem;
    }

    .civ-row-identity .civilization-icon {
        width: 24px;
        height: 24px;
    }

    .civ-winrate {
        grid-column: 3;
        padding-inline: 5px;
        font-size: 0.8rem;
    }

    .civ-expand-button {
        width: calc(100% - 16px);
        margin-inline: 8px;
    }

    .civ-best-content {
        grid-template-columns: 1fr;
        height: auto;
        min-height: 0;
        padding: 0 18px 20px;
    }

    .civ-best-card {
        height: auto;
    }

    .civ-best-emblem {
        min-height: 230px;
    }

    .civ-best-summary {
        min-height: 0;
        padding: 18px 0 0;
        border-top: 1px solid rgba(232, 185, 71, 0.3);
        border-left: 0;
    }

    .civ-best-name {
        margin-bottom: 18px;
    }
}

/* Compact player profile: keep the header content in normal flow and use one scroll area. */
@media (max-width: 560px) {
    body #player-stats-modal .modal-content.wide-modal {
        width: calc(100vw - 8px) !important;
        height: calc(100vh - 8px) !important;
        height: calc(100dvh - 8px) !important;
        max-height: calc(100vh - 8px) !important;
        max-height: calc(100dvh - 8px) !important;
        margin: 4px auto !important;
        border-radius: 10px !important;
    }

    #player-stats-content {
        height: 100%;
        min-height: 0;
    }

    .concept-player-stats.player-stats-container,
    .concept-player-stats.modern-player-stats {
        height: 100%;
        max-height: none;
        padding:
            max(8px, env(safe-area-inset-top))
            max(8px, env(safe-area-inset-right))
            max(8px, env(safe-area-inset-bottom))
            max(8px, env(safe-area-inset-left));
        border-radius: 9px;
    }

    .concept-player-stats .concept-player-header {
        max-height: none;
        margin-bottom: 8px;
        padding: 2px 4px 0 !important;
        overflow: visible;
    }

    .concept-player-header .player-title-wrapper {
        gap: 10px;
    }

    .concept-player-stats .player-stats-title-block {
        align-items: center;
        padding-right: 44px;
    }

    .concept-player-stats .player-stats-avatar-frame {
        width: 48px !important;
        height: 48px !important;
        flex-basis: 48px !important;
    }

    .concept-player-stats .modern-player-heading {
        min-width: 0;
    }

    .concept-player-stats .player-nickname-title {
        display: block;
        font-size: 1rem;
        line-height: 1.25;
        text-align: left;
        overflow-wrap: anywhere;
    }

    .concept-player-stats .comparison-container {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        width: 100%;
        gap: 8px;
        margin: 0;
    }

    .concept-player-stats .comparison-search-input {
        width: 100%;
        min-width: 0;
        min-height: 44px;
        padding: 10px 12px;
        font-size: 16px !important;
    }

    .concept-player-stats .compare-action-btn {
        width: auto;
        min-width: 104px;
        min-height: 44px;
        padding-inline: 14px;
    }

    .concept-player-stats .concept-player-tabs {
        display: flex;
        min-height: 46px;
        margin: 0 0 8px;
        overflow-x: auto;
        overflow-y: hidden;
        scroll-snap-type: x proximity;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }

    .concept-player-stats .concept-player-tabs::-webkit-scrollbar {
        display: none;
    }

    .concept-player-tabs .stats-nav-button {
        flex: 1 0 auto;
        min-width: 112px;
        min-height: 44px;
        padding-inline: 12px;
        border-right: 1px solid rgba(154, 166, 181, 0.06);
        border-bottom: 0;
        scroll-snap-align: start;
    }

    .concept-player-main {
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
    }

    .concept-player-stats .rating-chart-header {
        flex-direction: row;
        align-items: center;
    }

    .concept-player-stats .rating-chart-zoom-controls {
        gap: 6px;
    }

    .concept-player-stats .rating-zoom-btn {
        min-width: 42px;
        min-height: 32px;
    }

    #player-stats-modal .close {
        top: 10px;
        right: 10px;
        width: 40px;
        height: 40px;
        font-size: 24px;
    }
}

@media (max-width: 380px) {
    .concept-player-stats .comparison-container {
        grid-template-columns: 1fr;
    }

    .concept-player-stats .compare-action-btn {
        width: 100%;
    }

    .concept-player-stats .rating-chart-header {
        align-items: flex-start;
        flex-direction: column;
    }
}

/* Reference-style player match cards. */
.concept-match-card { min-height: 0; padding: 9px 9px 3px; border: 1px solid #263c4b; border-radius: 8px; background: linear-gradient(145deg, #07131a, #020b10 75%); }
.concept-match-card.win, .concept-match-card.loss { border-left-color: #263c4b; }
.concept-match-card .match-header { align-items: center; gap: 4px; min-height: 17px; margin: 0 0 6px; }
.concept-match-card .match-map { display: block; min-width: 0; font-size: 12px; line-height: 1.4; white-space: nowrap; }
.concept-match-mode { color: #e8bf58; }
.concept-match-card .match-date { flex-shrink: 0; color: #a0adba; font-size: 10px; }
.concept-match-banner { display: flex; align-items: center; justify-content: space-between; height: 52px; padding: 3px; margin-bottom: 7px; overflow: hidden; border-radius: 6px; background: linear-gradient(90deg, #07162222, #07162244 65%, #071622), url('/static/aoe-back-optimized.webp') center 45% / cover; }
.concept-match-medallion { display: grid; place-items: center; width: 44px; height: 44px; border: 2px solid #c4a453; border-radius: 50%; background: #19241cdd; box-shadow: 0 0 0 3px #07121b99, inset 0 0 8px #e4c87855; }
.concept-match-card .concept-match-medallion .match-civ-icon { width: 36px; height: 36px; border: 0; object-fit: contain; }
.concept-match-card .rating-change-badge { align-self: flex-start; width: auto; min-width: 38px; height: 30px; padding: 0 6px; border-radius: 6px; font-size: 19px; background: #091726d9; }
.concept-match-card .rating-change-badge.negative { color: #ff574e; border-color: #a53737; }
.concept-match-card .rating-change-badge.positive { color: #8adc77; border-color: #397b52; }
.concept-match-card .match-rating-delta { min-height: 26px; margin-bottom: 4px; padding: 0 8px; }
.concept-match-card .match-rating-delta .delta-value { color: #eac44d; font-size: 15px; }
.concept-match-card .match-content { flex: 0 0 auto; gap: 0; }
.concept-match-card .match-team { display: grid; grid-template-columns: 64px minmax(0, 1fr); align-items: center; height: 35px; min-height: 35px; box-sizing: border-box; gap: 3px; padding: 3px 2px; border: 0; border-radius: 0; border-bottom: 1px solid #25384880; background: transparent; }
.concept-match-card .match-team:last-child { border-bottom-color: transparent; }
.concept-match-card .match-team-label { font-size: 10px; }
.concept-match-card .recent-match-avatar-stack { display: flex; align-items: center; min-width: 0; }
.concept-match-card .recent-match-avatar { width: 25px; height: 25px; flex: 0 0 25px; margin-left: -6px; border: 2px solid #baa05d; border-radius: 50%; object-fit: cover; background: #15283a; box-shadow: 0 1px 5px #0008; }
.concept-match-card .recent-match-avatar:first-child { margin-left: 0; }
.concept-match-card .player-avatar-fallback { display: grid; place-items: center; color: #f3deb0; font-size: 12px; }
@media (min-width: 1081px) { .concept-match-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; } }
@media (max-width: 1080px) and (min-width: 769px) { .concept-match-card .match-header { flex-wrap: wrap; } .concept-match-card .match-team { grid-template-columns: 62px minmax(0, 1fr); gap: 3px; } .concept-match-card .recent-match-avatar { width: 25px; height: 25px; flex-basis: 25px; margin-left: -7px; } }
/* Dark surfaces and restrained gold controls for the statistics overview. */
.concept-player-stats .recent-matches-section,
.concept-player-stats .modern-list-card,
.concept-player-stats .rating-chart-container,
.concept-player-stats .concept-footer-stat { border-color: rgba(70, 86, 94, 0.46); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025), 0 8px 20px rgba(0, 0, 0, 0.16); }
.concept-player-stats .comparison-search-input { background: #081219; border-color: #263039; }
.concept-player-stats .compare-action-btn { border: 1px solid #c9a253; color: #161710; box-shadow: inset 0 1px 0 #ffe8a433; }
.concept-player-stats .rating-zoom-btn,
.concept-player-stats .rating-zoom-value { background: #071117; }
.concept-player-stats .rating-zoom-btn { border-color: #263039; }
.concept-player-stats .rating-zoom-value { border-color: #b68a36; }
.concept-match-card { border-color: #27363d; }
.concept-match-card.win, .concept-match-card.loss { border-left-color: #27363d; }
.concept-match-card .match-rating-delta[class*="advantage"] { background: linear-gradient(180deg, #123c2bcc, #08251dcc); border-color: #28553d; }
.concept-match-card .match-rating-delta[class*="disadvantage"] { background: linear-gradient(180deg, #473b1fcc, #2c2515cc); border-color: #716031; }
.concept-match-card .match-rating-delta.delta-neutral { background: #10251f; border-color: #284239; }
.concept-match-card .rating-change-badge { background: #061015e8; }
.concept-match-card .match-team { border-bottom-color: #23303880; }
.concept-match-card .match-team:last-child { border-bottom-color: transparent; }
/* Low-contrast frames matching the dark statistics surfaces. */
body #player-stats-modal .modal-content.wide-modal { border-color: #19262d !important; }
.concept-player-stats .recent-matches-section,
.concept-player-stats .modern-list-card,
.concept-player-stats .rating-chart-container,
.concept-player-stats .concept-footer-stat { border-color: #19262d; }
.concept-player-stats .concept-player-tabs { border-color: #152128; }
.concept-match-card,
.concept-match-card.win,
.concept-match-card.loss { border-color: #1b2b32; }
.concept-match-card .match-team { border-bottom-color: #17252c; }
.concept-match-card .match-team:last-child { border-bottom-color: transparent; }
.concept-player-stats .comparison-search-input,
.concept-player-stats .rating-zoom-btn { border-color: #1b272f; }
body #player-stats-modal .close { border-color: #1b272f; }
.concept-player-stats .rating-chart-zoom-controls { flex-wrap: wrap; gap: 10px; }
.rating-period-controls, .rating-scale-controls { display: inline-flex; align-items: center; overflow: hidden; border: 1px solid #1b2b34; border-radius: 8px; background: #061118; }
.concept-player-stats .rating-period-btn { min-width: 44px; height: 34px; padding: 0 12px; border: 0; border-right: 1px solid #17262e; background: transparent; color: #b6c0ca; font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; }
.concept-player-stats .rating-period-btn:last-child { border-right: 0; }
.concept-player-stats .rating-period-btn.active { color: var(--concept-yellow); border-radius: 7px; background: linear-gradient(180deg, #b78d261a, #b78d2605); box-shadow: inset 0 0 0 1px #a27b2c; }
.concept-player-stats .rating-period-btn:hover { color: var(--concept-yellow); background-color: #d1aa4610; }
.concept-player-stats .rating-scale-controls .rating-zoom-btn, .concept-player-stats .rating-scale-controls .rating-zoom-value { border: 0; border-radius: 0; background: transparent; }
.concept-player-stats .rating-scale-controls .rating-zoom-value { width: 58px; min-width: 58px; border-inline: 1px solid #17262e; color: #bdc7d0; font-size: 12px; font-weight: 500; }
.concept-player-stats .rating-reset-btn { font-size: 22px; font-weight: 400; }
.concept-player-stats .rating-period-btn:focus-visible, .concept-player-stats .rating-zoom-btn:focus-visible { outline: 2px solid var(--concept-yellow); outline-offset: -3px; }
@media (max-width: 768px) { .concept-player-stats .rating-chart-header { flex-wrap: wrap; } .concept-player-stats .rating-chart-zoom-controls { flex: 1 1 100%; } .concept-player-stats .rating-period-btn { min-width: 36px; padding-inline: 9px; } }
/* Player relationships follow the overview's dark panels and gold accents. */
.concept-player-stats .player-relation-card { border-color: #19262d; background: linear-gradient(180deg, #051016e8, #020b10f5), url('/static/aoe-back-optimized.webp') center top / cover; }
.concept-player-stats .player-relation-columns.is-percent,
.concept-player-stats .player-relation-row.is-percent,
.concept-player-stats .player-relation-columns.is-score,
.concept-player-stats .player-relation-row.is-score { grid-template-columns: 28px minmax(0, 1fr) 66px; gap: 9px; }
.concept-player-stats .player-relation-columns.without-rank,
.concept-player-stats .player-relation-row.without-rank { grid-template-columns: minmax(0, 1fr) 66px; }
.concept-player-stats .player-relation-row { min-height: 44px; padding: 4px 6px; margin-bottom: 0; border: 0; border-bottom: 1px solid #17252c; border-radius: 0; background: transparent; }
.concept-player-stats .player-relation-row:hover { background: #ffffff03; }
.concept-player-stats .player-relation-identity { display: flex; align-items: center; gap: 10px; min-width: 0; }
.concept-player-stats .player-relation-identity .recent-match-avatar-stack { display: flex; flex: 0 0 32px; }
.concept-player-stats .player-relation-identity .recent-match-avatar,
.concept-player-stats .player-relation-avatar-fallback { display: grid; place-items: center; width: 32px; height: 32px; flex: 0 0 32px; margin: 0; border: 1px solid #b9964c; border-radius: 50%; object-fit: cover; background: #0a1921; color: #e4c778; }
.concept-player-stats .player-relation-rank { display: grid; place-items: center; width: 27px; height: 27px; border: 1px solid #263944; border-radius: 50%; background: linear-gradient(145deg, #14252f, #08131a); font-weight: 600; font-size: 13px; }
.concept-player-stats .player-relation-rank.is-first { border-color: #6d5930; background: linear-gradient(145deg, #342e1c, #111914); color: #f0dca5; }
.concept-player-stats .player-relation-winrate,
.concept-player-stats .player-relation-score { display: grid; place-items: center; min-width: 62px; padding: 6px 7px; border: 1px solid transparent; border-radius: 5px; font-size: 14px; line-height: 1.1; text-align: center; }
.concept-player-stats .player-relation-winrate.is-positive,
.concept-player-stats .player-relation-score.is-success { color: #6cd980; background: #0a3021b3; border-color: #153e2b; }
.concept-player-stats .player-relation-winrate.is-warning { color: var(--concept-yellow); background: #3a301bb3; border-color: #493c21; }
.concept-player-stats .player-relation-score.is-danger { color: #ef6262; background: #2c1418b3; border-color: #412026; }
.concept-player-stats .player-relation-expand { justify-content: space-between; border-color: #1d2c34; background: #06111799; font-weight: 500; }
.concept-player-stats .player-relation-expand:hover { color: var(--concept-yellow); border-color: #6d5930; }
.concept-player-stats .player-relation-header h3 { font-weight: 600 !important; }
.concept-player-stats .player-relation-icon { width: 36px; height: 36px; flex-basis: 36px; }
.concept-player-stats .player-relation-header-image { display: block; width: 36px; height: 36px; object-fit: contain; border-radius: 50%; }

/* Four civilization panels, matching the dark statistics overview. */
.concept-player-stats .civilizations-dashboard-top,
.concept-player-stats .civilizations-dashboard-bottom { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: stretch; gap: 14px; }
.concept-player-stats .civ-stats-card,
.concept-player-stats .civ-best-card { border-color: rgba(var(--civ-accent-rgb), .35); background: linear-gradient(110deg, #041017f5, #041017cc), url('/static/aoe-back-optimized.webp') center top / cover; box-shadow: inset 0 1px 0 #ffffff04, 0 8px 20px #0003; font-family: "Roboto", "Inter", sans-serif; }
.concept-player-stats .civ-card-popular,
.concept-player-stats .civ-best-card { height: auto; min-height: 330px; }
.concept-player-stats .civ-best-card { background: radial-gradient(ellipse at 30% 65%, #aa7e2526, transparent 60%), linear-gradient(110deg, #13150feb, #041017e8), url('/static/aoe-back-optimized.webp') center / cover; }
.concept-player-stats header.civ-card-header { background: transparent; box-shadow: none; }
.concept-player-stats .civ-card-header h3 { font-size: 18px; font-weight: 600; }
.concept-player-stats .civ-card-header p { color: #9daab4; font-size: 12px; }
.concept-player-stats .civ-card-icon { width: 44px; height: 44px; flex-basis: 44px; border: 1px solid rgba(var(--civ-accent-rgb), .4); border-radius: 50%; background: rgba(var(--civ-accent-rgb), .08); }
.concept-player-stats .civ-table-head,
.concept-player-stats .civ-stat-row { display: grid; align-items: center; grid-template-columns: 27px minmax(0, 1.4fr) minmax(78px, .8fr) minmax(45px, .7fr) 65px; gap: 8px; }
.concept-player-stats .civ-table-head { background: transparent; font-size: 10px; padding: 0 8px 5px; }
.concept-player-stats .civ-stats-list { background: transparent; }
.concept-player-stats .civ-stat-row { min-height: 40px; padding: 4px 8px; background: transparent; border-bottom-color: #192830; }
.concept-player-stats .civ-row-identity { gap: 8px; }
.concept-player-stats .civ-row-identity > span { font-size: 12px; font-weight: 500; }
.concept-player-stats .civ-row-detail { font-size: 11px; }
.concept-player-stats .civ-winrate { font-size: 12px; font-weight: 600; min-width: 62px; text-align: center; }
.concept-player-stats .civ-card-popular .civ-winrate { color: #77bdf0; background: #143550b3; }
.concept-player-stats .civ-row-bar > span { box-shadow: none; }
.concept-player-stats .civ-expand-button { justify-content: space-between; flex-direction: row-reverse; border-color: rgba(var(--civ-accent-rgb), .25); color: #b9c3cb; font-weight: 500; }
.concept-player-stats .civ-expand-button:hover { color: var(--civ-accent); border-color: rgba(var(--civ-accent-rgb), .5); }
.concept-player-stats .civ-best-content { min-height: 240px; height: auto; padding: 10px 20px 20px; }
.concept-player-stats .civ-best-name { font-size: 23px; }
.concept-player-stats .civ-best-rate { color: #69d581; font-size: 36px; }
@media (max-width: 1000px) { .concept-player-stats .civ-table-head, .concept-player-stats .civ-stat-row { grid-template-columns: 24px minmax(0, 1fr) 70px 60px; gap: 5px; } .concept-player-stats .civ-row-bar, .concept-player-stats .civ-table-head span:nth-child(4) { display: none; } }
@media (max-width: 768px) { .concept-player-stats .civilizations-dashboard-top, .concept-player-stats .civilizations-dashboard-bottom { grid-template-columns: 1fr; } }
.concept-player-stats .civ-card-icon { border: 0; background: transparent; }
.concept-player-stats .civ-panel-header-image { display: block; width: 44px; height: 44px; object-fit: contain; }
.concept-player-stats .civ-best-content { grid-template-columns: minmax(0, 1fr) minmax(130px, .9fr); }
.concept-player-stats .civ-best-emblem { height: 260px; overflow: hidden; }
.concept-player-stats .civ-best-emblem::before,
.concept-player-stats .civ-best-emblem::after { content: none; }
.concept-player-stats .civ-best-banner { display: block; height: 100%; width: 100%; object-fit: contain; }
.concept-player-stats .civ-best-emblem .civilization-icon,
.concept-player-stats .civ-best-emblem .civilization-icon:not(.fallback):hover { position: absolute; left: 50%; top: 43%; width: 76px; height: 76px; margin: 0; transform: translate(-50%, -50%); border: 0; border-radius: 50%; clip-path: none; background: transparent; filter: drop-shadow(0 3px 7px #0009); box-shadow: none; }
.concept-player-stats .civ-best-emblem .civilization-icon img { width: 100%; height: 100%; object-fit: contain; border-radius: 50%; }
@media (max-width: 480px) { .concept-player-stats .civ-best-emblem { height: 220px; } .concept-player-stats .civ-best-emblem .civilization-icon { width: 60px; height: 60px; } }
.concept-player-stats .civ-best-banner { width: 66.666%; height: 66.666%; }
.concept-player-stats .civ-best-emblem .civilization-icon,
.concept-player-stats .civ-best-emblem .civilization-icon:not(.fallback):hover { width: 50px; height: 50px; top: 45.333%; }
@media (max-width: 480px) { .concept-player-stats .civ-best-emblem .civilization-icon { width: 40px; height: 40px; } }
/* Let the popular list determine the shared top-row height. */
.concept-player-stats .civ-card-popular,
.concept-player-stats .civ-best-card { min-height: 0; height: auto; }
.concept-player-stats .civ-card-popular .civ-stats-list { margin-bottom: 6px; }
.concept-player-stats .civ-best-card { display: flex; flex-direction: column; }
.concept-player-stats .civ-best-content { flex: 1; min-height: 0; padding: 4px 18px 6px; }
.concept-player-stats .civ-best-emblem { height: 190px; }
.concept-player-stats .civ-best-banner { transform: translateY(-22px); }
.concept-player-stats .concept-full-matches { padding: 14px; background: linear-gradient(145deg, #06131ae8, #030d13f5); }
.concept-full-matches .modern-card-heading { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }
.full-matches-controls, .full-matches-filters { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.full-matches-controls { gap: 14px; }
.full-matches-summary { color: #84929c; font-size: 11px; }
.full-matches-summary .positive { color: #69d77d; }
.full-matches-summary .negative { color: #ef6464; }
.full-match-filter { padding: 6px 16px; border: 1px solid #1b2b34; border-radius: 20px; color: #b7c2cc; background: #07131a; font: inherit; font-size: 11px; cursor: pointer; }
.full-match-filter.active { color: var(--concept-yellow); border-color: #a9893f; background: #ac862414; }
.full-match-filter:hover, .full-match-filter:focus-visible { border-color: #a9893f; }
.full-matches-scroll { overflow-x: auto; }
.concept-full-matches .full-match-table-head,
.concept-full-matches .modern-match-row { display: grid; grid-template-columns: 28px minmax(200px, 2.3fr) minmax(90px, 1fr) minmax(85px, 1fr) minmax(60px, .7fr) 90px; align-items: center; gap: 10px; min-width: 670px; }
.full-match-table-head { min-height: 34px; padding: 0 10px; background: #0b1b2580; border: 1px solid #172a35; border-radius: 6px 6px 0 0; color: #95a8b5; font-size: 10px; text-transform: uppercase; }
.concept-full-matches .modern-match-list { gap: 0; }
.concept-full-matches .modern-match-row { min-height: 37px; margin: 0; padding: 4px 10px; border: 0; border-bottom: 1px solid #ffffff06; border-radius: 5px; background: #08151b; font-size: 11px; }
.concept-full-matches .modern-match-row.win { background: linear-gradient(90deg, #0b322c99, #08212799); }
.concept-full-matches .modern-match-row.loss { background: linear-gradient(90deg, #321b2599, #211a2499); }
.concept-full-matches .modern-match-row[hidden], .concept-full-matches [hidden] { display: none; }
.concept-full-matches .modern-match-main { display: flex; align-items: center; gap: 10px; min-width: 0; }
.concept-full-matches .modern-match-main strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; font-weight: 500; }
.full-match-mode { margin-left: auto; color: #9badb8; font-size: 10px; white-space: nowrap; }
.concept-full-matches .modern-match-date { color: #a6b9c4; font-size: 10px; }
.concept-full-matches .match-civ-icon { width: 26px; height: 26px; flex: 0 0 26px; border: 1px solid #ac8a37; border-radius: 50%; }
.full-match-civilization { display: flex; justify-content: center; }
.concept-full-matches .modern-match-result { width: 82px; padding: 4px 6px; border: 1px solid #27503d; border-radius: 5px; background: #0b3d2799; color: #69d77d; text-align: center; font-size: 10px; }
.concept-full-matches .modern-match-result.loss { background: #3a171c99; border-color: #653033; color: #ef6464; }
.concept-full-matches .modern-match-result.unknown { background: #17232b; border-color: #2d3c46; color: #afbac4; }
.concept-full-matches .modern-rating-change { font-size: 13px; font-weight: 700; }