:root {
    --bg: #0d0909;
    --bg-card: #1a0f0f;
    --bg-input: #0d0909;
    --border: #2a1515;
    --border-light: rgba(42,21,21,0.5);
    --primary: #c62828;
    --primary-hover: #e53935;
    --accent: #ff5252;
    --text: #d4c0c0;
    --text-muted: #807070;
    --text-bright: #f0e0e0;
    --danger: #b71c1c;
    --green: #2e7d32;
    --gold: #ffd700;
    --silver: #c0c0c0;
    --bronze: #cd7f32;
}

* { margin:0; padding:0; box-sizing:border-box; }

* { cursor: default; }

a, button, [role="button"], select, label, input[type="checkbox"], input[type="radio"], summary, [onclick] {
    cursor: pointer;
}

input:not([type="checkbox"]):not([type="radio"]):not([type="range"]), textarea, [contenteditable="true"] {
    cursor: text;
}

button:disabled, select:disabled, input:disabled, [disabled] {
    cursor: not-allowed;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
}

header {
    background: linear-gradient(135deg, #1a0f0f 0%, #0d0909 100%);
    border-bottom: 2px solid var(--primary);
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

header h1, .app-header h1 {
    color: var(--primary);
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 1px;
}

header h1 span, .app-header h1 span {
    color: var(--text-bright);
    font-weight: 300;
}

header a {
    color: var(--text);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s;
}

header a:hover { color: var(--accent); }

.app-header {
    background: linear-gradient(135deg, #1a0f0f 0%, #0d0909 100%);
    border-bottom: 2px solid var(--primary);
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}

.app-header .brand { display:flex; align-items:center; gap:16px; }

.app-header .brand a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 13px;
    transition: color 0.2s;
}

.app-header .brand a:hover { color: var(--accent); }

.lang-switch {
    display: flex;
    gap: 2px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 2px;
}

.lang-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    padding: 4px 6px;
    border-radius: 3px;
    opacity: 0.45;
    filter: grayscale(100%);
    transition: all 0.2s;
}

.lang-btn:hover { opacity: 0.8; filter: grayscale(20%); }

.lang-btn.active {
    opacity: 1;
    filter: none;
    background: var(--bg-card);
    box-shadow: 0 0 0 1px var(--primary);
}

.app-nav {
    display: flex;
    gap: 4px;
}

.app-nav button {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 8px 18px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s;
}

.app-nav button:hover { border-color: var(--primary); color: var(--accent); }

.app-nav button.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px;
}

.page { display: none; }
.page.active { display: block; }

.stats-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    align-items: start;
}

.stats-layout.has-friends {
    grid-template-columns: 220px 1fr;
}

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

.back-to-me-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    background: var(--bg-card);
    border: 1px solid var(--accent);
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 20px;
    font-size: 13px;
    color: var(--text);
}

.back-to-me-banner .btn-sm {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 8px 14px;
    cursor: pointer;
}

.friends-col {
    min-width: 0;
    align-self: stretch;
}

.friends-panel {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
    position: sticky;
    top: 16px;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
}

.friends-panel h3 {
    color: var(--accent);
    font-size: 15px;
    margin: 0 0 12px;
}

.friends-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.friend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    transition: background .15s;
    user-select: none;
    border: 1px solid transparent;
}

.friend-item,
.friend-item * {
    cursor: pointer;
}

.friend-item:hover { background: var(--bg-input); }

.friend-item.active {
    background: linear-gradient(135deg, rgba(198, 40, 40, 0.28), rgba(198, 40, 40, 0.10));
    border: 1px solid var(--accent);
    box-shadow: inset 3px 0 0 var(--accent);
}

.friend-item.active .friend-name { color: var(--accent); }

.friend-item img,
.friend-item .friend-avatar-fallback {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid var(--border);
    flex-shrink: 0;
}

.friend-item .friend-avatar-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-input);
    font-size: 10px;
    color: var(--text-muted);
}

.friend-item .friend-meta { min-width: 0; }

.friend-item .friend-name {
    font-size: 13px;
    color: var(--text-bright);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.friend-item .friend-elo {
    font-size: 11px;
    color: var(--text-muted);
}

.friends-empty {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.4;
}

.group-block {
    margin-bottom: 14px;
}

.group-block:last-child { margin-bottom: 0; }

.group-block-name {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--accent);
    padding: 0 4px 6px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 6px;
}

@media (max-width: 820px) {
    .stats-layout,
    .stats-layout.has-friends { grid-template-columns: 1fr; }
    .friends-col { align-self: auto; }
    .friends-panel { position: static; max-height: none; }
}

.card {
    background: var(--bg-card);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid var(--border);
}

.card h2 {
    color: var(--accent);
    font-size: 18px;
    margin-bottom: 16px;
}

.card h3 {
    color: var(--text-bright);
    font-size: 15px;
    margin-bottom: 10px;
}

.section-divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 16px 0 10px;
    opacity: .6;
}

.section-note {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.55;
    margin: 0;
}

.form-group { margin-bottom: 12px; }

.form-group label {
    display: block;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

input, select {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text);
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

input:focus, select:focus { border-color: var(--primary); }

button {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

button:hover { background: var(--primary-hover); }

button:disabled { opacity: 0.4; cursor: not-allowed; }

button.secondary {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
}

button.secondary:hover { border-color: var(--primary); color: var(--accent); }

button.danger { background: var(--danger); }
button.danger:hover { background: #e53935; }

.btn-sm { padding: 6px 12px; font-size: 12px; }

.metric-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.metric-tabs .metric-tab { flex: 0 0 auto; }

table { width: 100%; border-collapse: collapse; }

th, td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}

th {
    color: var(--accent);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Keep the parameter name column visible while the table scrolls sideways */
.results-table-wrap table th:first-child,
.results-table-wrap table td:first-child {
    position: sticky;
    left: 0;
    z-index: 2;
    background: var(--bg-card);
    border-right: 1px solid var(--border);
}

.results-table-wrap table thead th:first-child {
    z-index: 3;
}

.results-table-wrap th {
    white-space: nowrap;
}

tr:hover td { background: rgba(198,40,40,0.05); }

.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.badge-elo {
    background: var(--primary);
    color: #fff;
}

.player-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.player-header img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--primary);
}

.empty-state {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
}

.empty-state p { margin-bottom: 8px; }

/* ========== LOADING ========== */

.loading-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 60px 20px;
    text-align: center;
}

.loading-wrap .spinner {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 4px solid rgba(255, 82, 82, 0.15);
    border-top-color: var(--accent);
    animation: histats-spin 0.9s linear infinite;
}

.loading-wrap .spinner-inner {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 3px solid rgba(198, 40, 40, 0.15);
    border-bottom-color: var(--primary);
    animation: histats-spin 1.3s linear infinite reverse;
}

.loading-wrap .loading-label {
    color: var(--text-muted);
    font-size: 14px;
}

.loading-wrap .loading-note {
    color: var(--text-muted);
    opacity: .7;
    font-size: 12px;
    margin-top: 6px;
}

.loading-wrap .loading-dots::after {
    content: '';
    animation: histats-dots 1.4s steps(4, end) infinite;
}

.loading-wrap .loading-wait {
    max-width: 340px;
    padding: 12px 18px;
    border-radius: 12px;
    border: 1px solid rgba(255, 82, 82, 0.25);
    background: linear-gradient(135deg, rgba(198, 40, 40, 0.12) 0%, rgba(198, 40, 40, 0.05) 100%);
    color: var(--text);
    font-size: 13px;
    line-height: 1.55;
    animation: histats-wait-in 0.5s ease both, histats-wait-pulse 2.4s ease-in-out infinite 0.6s;
}

.loading-wrap .loading-wait-title {
    color: var(--accent);
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 2px;
}

@keyframes histats-wait-in {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes histats-wait-pulse {
    0%, 100% { border-color: rgba(255, 82, 82, 0.25); }
    50% { border-color: rgba(255, 82, 82, 0.7); }
}

@keyframes histats-spin {
    to { transform: rotate(360deg); }
}

@keyframes histats-dots {
    0% { content: ''; }
    25% { content: '.'; }
    50% { content: '..'; }
    75% { content: '...'; }
    100% { content: ''; }
}

/* ========== LANDING PAGE ========== */

.landing-hero {
    text-align: center;
    padding: 80px 24px 60px;
    background: radial-gradient(ellipse at center top, rgba(198,40,40,0.08) 0%, transparent 60%);
}

.landing-hero h1 {
    font-size: 48px;
    font-weight: 800;
    color: var(--text-bright);
    margin-bottom: 16px;
}

.landing-hero h1 span { color: var(--accent); }

.landing-hero p {
    font-size: 18px;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto 32px;
    line-height: 1.6;
}

.landing-hero .btn-cta {
    display: inline-block;
    background: var(--primary);
    color: #fff;
    padding: 14px 40px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 700;
    text-decoration: none;
    transition: transform 0.2s, box-shadow 0.2s;
}

.landing-hero .btn-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(198,40,40,0.4);
}

.btn-bot {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, #2AABEE 0%, #229ED9 100%);
    color: #fff;
    padding: 14px 32px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 16px rgba(42,171,238,0.3);
}

.btn-bot:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(42,171,238,0.5);
}

.btn-bot svg {
    width: 22px;
    height: 22px;
}

.landing-section {
    padding: 60px 24px;
    max-width: 1100px;
    margin: 0 auto;
}

.landing-section:nth-child(even) {
    background: rgba(198,40,40,0.02);
    border-top: 1px solid rgba(198,40,40,0.06);
    border-bottom: 1px solid rgba(198,40,40,0.06);
}

.landing-section .content {
    display: flex;
    align-items: center;
    gap: 60px;
}

.landing-section .content.reverse { flex-direction: row-reverse; }

.landing-section .text { flex: 1; }

.landing-section .text h2 {
    font-size: 28px;
    color: var(--text-bright);
    margin-bottom: 12px;
}

.landing-section .text h2 span { color: var(--accent); }

.landing-section .text p {
    font-size: 15px;
    color: var(--text-muted);
    line-height: 1.7;
    margin-bottom: 16px;
}

.landing-section .text .step {
    display: inline-block;
    background: var(--primary);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 4px;
    margin-bottom: 8px;
}

.zone-bad { color: var(--danger); font-weight: 600; }
.zone-awesome { color: var(--gold); font-weight: 600; }

/* CSS illustrations */
.illustration { flex: 1; min-width: 300px; }

.illu-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}

.illu-card .illu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.illu-card .illu-header .title {
    color: var(--accent);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.illu-card .illu-header .badge {
    background: var(--border);
    color: var(--text-muted);
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 12px;
}

.illu-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-light);
    font-size: 13px;
}

.illu-row:last-child { border-bottom: none; }

.illu-row .label { color: var(--text-muted); }

.illu-row .value {
    color: var(--text-bright);
    font-weight: 600;
    text-align: right;
    min-width: 60px;
}

.illu-row .value.good { color: var(--green); }

.illu-row .bar-wrap {
    flex: 1;
    max-width: 140px;
    margin-left: 16px;
}

.illu-bar {
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
}

.illu-bar .fill {
    height: 100%;
    border-radius: 3px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
}

.illu-perf-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    align-items: center;
}

.illu-perf-bars .illu-row { font-size: 12px; }

.illu-perf-bars .illu-row .value { font-size: 12px; min-width: 44px; }

.illu-perf-bars .bar-wrap { max-width: none; margin-left: 12px; }

.illu-perf-radar svg {
    display: block;
    width: 100%;
    max-width: 230px;
    margin: 0 auto;
}

.illi-ring {
    fill: none;
    stroke: var(--text-muted);
    stroke-width: 1;
    opacity: 0.5;
}

.illi-spoke {
    stroke: var(--text-muted);
    stroke-width: 1;
    opacity: 0.35;
}

.illi-shape {
    fill: var(--accent);
    fill-opacity: 0.15;
    stroke: var(--accent);
    stroke-width: 2;
}

.illi-dot {
    fill: var(--accent);
    stroke: rgba(255, 255, 255, 0.85);
    stroke-width: 0.8;
}

.illi-label {
    font-size: 8px;
    fill: var(--text-muted);
    font-weight: 600;
}

.illu-legend {
    margin-top: 14px;
    padding-top: 10px;
    border-top: 1px solid var(--border-light);
    text-align: center;
    font-size: 11px;
    color: var(--text-muted);
    letter-spacing: 0.3px;
}

.illu-avatars {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: center;
    padding: 16px 0;
}

.illu-avatar {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.illu-avatar .av-box {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    color: var(--text-muted);
    background: var(--bg-input);
    text-align: center;
    line-height: 1.2;
    overflow: hidden;
}

.illu-avatar .av-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.illu-avatar .name { font-size: 11px; color: var(--text-muted); }

.illu-avatar .elo {
    font-size: 10px;
    color: var(--accent);
    font-weight: 700;
}

.illu-compare-table { width: 100%; }

.illu-compare-table th {
    font-size: 11px;
    padding: 8px 10px;
    text-align: center;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border);
}

.illu-compare-table th:first-child { text-align: left; }

.illu-compare-table td {
    font-size: 13px;
    padding: 8px 10px;
    text-align: center;
    border-bottom: 1px solid var(--border-light);
    color: var(--text);
}

.illu-compare-table td:first-child {
    text-align: left;
    color: var(--text-muted);
    font-weight: 500;
}

.illu-compare-table .highlight { background: rgba(198,40,40,0.08); }

.illu-compare-table .best {
    color: var(--green);
    font-weight: 700;
}

.illu-podium {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 24px;
    padding: 24px 0 16px;
}

.illu-podium-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.illu-podium-item .medal { font-size: 32px; }

.illu-podium-item .bar {
    width: 64px;
    border-radius: 6px 6px 0 0;
}

.illu-podium-item .bar.gold { height: 90px; background: linear-gradient(180deg, var(--gold), #b8860b); }
.illu-podium-item .bar.silver { height: 70px; background: linear-gradient(180deg, var(--silver), #808080); }
.illu-podium-item .bar.bronze { height: 50px; background: linear-gradient(180deg, var(--bronze), #8b4513); }

.illu-podium-item .p-name { font-size: 12px; color: var(--text); font-weight: 600; }
.illu-podium-item .p-val { font-size: 12px; color: var(--accent); font-weight: 700; }

.landing-cta {
    text-align: center;
    padding: 80px 24px;
}

.landing-cta h2 { font-size: 32px; color: var(--text-bright); margin-bottom: 16px; }

.landing-cta p { color: var(--text-muted); margin-bottom: 32px; font-size: 16px; }

.landing-cta .btn-cta {
    display: inline-block;
    background: var(--primary);
    color: #fff;
    padding: 16px 48px;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 700;
    text-decoration: none;
    transition: transform 0.2s, box-shadow 0.2s;
}

.landing-cta .btn-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(198,40,40,0.4);
}

footer.landing-footer {
    text-align: center;
    padding: 32px 24px;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 13px;
}

.site-footer {
    text-align: center;
    padding: 24px;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 12px;
}

.site-footer .powered {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-bottom: 8px;
    font-size: 13px;
}

.site-footer .powered svg { flex-shrink: 0; }

.site-footer .powered img.powered-logo {
    flex-shrink: 0;
    height: 33px;
    width: auto;
    border-radius: 4px;
}

.site-footer a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s;
}

.site-footer a:hover { color: var(--accent); }

/* ========== STATS CARD (like landing page) ========== */

.stats-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}

.stats-card .stats-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.stats-card .stats-card-header .title {
    color: var(--accent);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stats-card .stats-card-header .stats-card-subtitle {
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 500;
    text-align: right;
}

/* ========== DEMO APP SPECIFIC ========== */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.stat-box {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
    text-align: center;
}

.stat-box .stat-value {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-bright);
}

.stat-box .stat-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

.stat-box .stat-value.good { color: var(--green); }
.stat-box .stat-value.warn { color: var(--accent); }

.stats-rows {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 20px;
}

.perf-split {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 0;
    align-items: center;
}

.perf-split .stats-rows {
    margin-bottom: 0;
    padding-right: 32px;
}

.perf-split .radar-wrap {
    padding-left: 36px;
    border-left: 1px solid var(--border-light);
}

.radar-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
}

.radar-wrap .radar-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 100%;
    position: relative;
}

.radar-wrap .radar {
    width: 100%;
    height: auto;
    display: block;
}

.radar-caption {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--text-muted);
    opacity: 0.8;
    text-align: center;
    width: 100%;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--border-light);
}

.radar-caption-center {
    margin-top: 10px;
    width: auto;
    padding: 3px 10px;
    border-top: none;
    border-radius: 4px;
    background: var(--bg-card);
    white-space: nowrap;
    font-size: 11px;
    opacity: 0.9;
}

.radar-ring {
    fill: none;
    stroke: var(--text-muted);
    stroke-width: 1;
    opacity: 0.55;
}

.radar-ring-outer { stroke: var(--text-muted); opacity: 0.9; }

.radar-spoke {
    stroke: var(--text-muted);
    stroke-width: 1;
    opacity: 0.45;
}

.radar-shape {
    fill: var(--accent);
    fill-opacity: 0.14;
    stroke: var(--accent);
    stroke-width: 2.5;
    stroke-linejoin: round;
}

.radar-dot {
    stroke: rgba(255, 255, 255, 0.85);
    stroke-width: 1;
}

.radar-label {
    font-size: 8px;
    font-weight: 600;
    fill: var(--text-muted);
    letter-spacing: 0.3px;
}

.radar-value {
    font-size: 5.5px;
    font-weight: 700;
    fill: var(--text-bright);
    letter-spacing: 0;
    paint-order: stroke;
    stroke: var(--bg-card);
    stroke-width: 2px;
}

.stat-row {
    display: grid;
    grid-template-columns: 110px 1fr 70px;
    align-items: center;
    gap: 12px;
}

.stat-row-label {
    font-size: 12px;
    color: var(--text-muted);
    text-align: left;
}

.stat-row-hint {
    font-size: 8px;
    color: var(--text-muted);
    opacity: .7;
    line-height: 1.3;
    margin-top: 1px;
}

.stat-row-value {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-bright);
    text-align: right;
}

.stat-row-value.good { color: var(--green); }

.rating-bar {
    flex: 1;
    min-width: 140px;
    position: relative;
}

.rating-track {
    position: relative;
    height: 16px;
    border: 1px solid var(--border);
    border-radius: 4px;
    overflow: hidden;
    display: flex;
    background: var(--bg-input);
}

.rating-zone {
    height: 100%;
    opacity: 0.25;
}

.rating-fill {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    border-radius: 4px;
    transition: width .3s ease;
}

.rating-tick {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 1px;
    background: rgba(255, 255, 255, 0.75);
    z-index: 2;
}

.rating-caption {
    position: absolute;
    top: 100%;
    margin-top: 3px;
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    line-height: 1;
    opacity: 0.85;
    pointer-events: none;
    white-space: nowrap;
    z-index: 3;
}

.stat-plain-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 2px;
    border-bottom: 1px solid var(--border-light);
}

.stat-plain-row .stat-row-label { font-size: 13px; }
.stat-plain-row .stat-row-value { font-size: 16px; font-weight: 800; color: var(--text-bright); }

.clutch-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
}

.clutch-col {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px 16px;
}

.clutch-col .stat-plain-row:last-child { border-bottom: none; }

@media (max-width: 640px) {
    .clutch-columns { grid-template-columns: 1fr; }
}

.player-hero {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 24px;
}

.player-hero img {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: 3px solid var(--primary);
}

.player-hero .info h2 { color: var(--text-bright); font-size: 22px; margin-bottom: 4px; }
.player-hero .info .hero-period { color: var(--text-muted); font-size: 12px; margin-bottom: 4px; }
.player-hero .info .sub { color: var(--text-muted); font-size: 13px; }
.player-hero .info .sub img { width:20px; height:15px; border:none; outline:none; vertical-align:middle; margin-right:3px; }

.level-badge {
    display:inline-block;
    width:22px;height:22px;
    line-height:22px;
    text-align:center;
    border-radius:50%;
    font-size:11px;
    font-weight:700;
    color:#fff;
    vertical-align:middle;
}
.level-1  { background:#6d4c2e; }
.level-2  { background:#8d5e3c; }
.level-3  { background:#b8860b; }
.level-4  { background:#6b6b6b; }
.level-5  { background:#8a8a8a; }
.level-6  { background:#a8a8a8; }
.level-7  { background:#d4a017; }
.level-8  { background:#e8b800; }
.level-9  { background:#c69400; }
.level-10 { background:linear-gradient(135deg,#ff4500,#ff6347);box-shadow:0 0 6px rgba(255,69,0,0.6); }

.level-badge-img {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    vertical-align: middle;
    margin-left: 4px;
}
.player-hero .info .sub img.level-badge-img {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    vertical-align: middle;
    margin-left: 4px;
    margin-right: 0;
}

.group-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
}

.group-card .group-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.group-card .group-header h3 { color: var(--accent); font-size: 16px; margin: 0; }

.group-card .group-name-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}

.group-avg-elo {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.3px;
    padding: 3px 9px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 999px;
    white-space: nowrap;
}

.group-avg-elo b { color: var(--accent); font-weight: 700; }

.group-members {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.group-member {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 8px 12px;
}

.group-member img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid var(--primary);
}

.group-member .no-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 7px;
    color: var(--text-muted);
    background: var(--bg);
    text-align: center;
    line-height: 1.1;
}

.group-member .g-name { font-size: 13px; color: var(--text); font-weight: 600; }
.group-member .g-elo { font-size: 11px; color: var(--accent); }

.results-podium {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 16px;
    padding: 32px 0 24px;
    flex-wrap: wrap;
}

.results-period {
    display: inline-block;
    margin-left: 12px;
    padding: 3px 12px;
    font-size: 12px;
    font-weight: 600;
    color: var(--accent);
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 999px;
    vertical-align: middle;
}

.results-podium-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.results-podium-item .medal { font-size: 28px; }

.results-podium-item .bar {
    width: 80px;
    border-radius: 6px 6px 0 0;
    transition: height 0.4s;
    position: relative;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 8px;
    font-size: 14px;
    font-weight: 800;
    color: #fff;
}

.results-podium-item .bar.gold { background: linear-gradient(180deg, var(--gold), #b8860b); }
.results-podium-item .bar.silver { background: linear-gradient(180deg, var(--silver), #606060); }
.results-podium-item .bar.bronze { background: linear-gradient(180deg, var(--bronze), #8b4513); }
.results-podium-item .bar.plain { background: linear-gradient(180deg, var(--accent), rgba(0,0,0,.55)); }

.results-podium-item .p-rank { font-size: 14px; font-weight: 700; color: var(--text-muted); }

.results-podium-item .p-name { font-size: 13px; color: var(--text); font-weight: 600; }

.compare-controls {
    display: flex;
    gap: 12px;
    align-items: end;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.compare-controls .form-group { margin: 0; min-width: 180px; }

.results-hint { margin-top: 4px; }

.coop-check {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    cursor: pointer;
    user-select: none;
    font-size: 13px;
    color: var(--text);
    white-space: nowrap;
}

.coop-check input[type="checkbox"] {
    width: auto;
    margin: 0;
    accent-color: var(--primary);
}

.coop-hint { margin-top: 8px; }

.groups-hint { margin-top: 16px; }

.modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.7);
    z-index: 1000;
}

.modal-box {
    background: var(--bg-card);
    max-width: 420px;
    margin: 80px auto;
    padding: 24px;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.modal-box h2 { color: var(--accent); margin-bottom: 16px; }

@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 768px) {
    header, .app-header { flex-direction: column; gap: 12px; }
    nav, .app-nav { flex-wrap: wrap; justify-content: center; }
    table { font-size: 12px; }
    th, td { padding: 6px 8px; }
    .landing-hero h1 { font-size: 32px; }
    .landing-section .content, .landing-section .content.reverse { flex-direction: column; gap: 32px; }
    .illustration { min-width: auto; width: 100%; }
    .illu-perf-split { grid-template-columns: 1fr; }
    .illu-podium { gap: 12px; }
    .illu-podium-item .bar { width: 48px; }
    .stats-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
    .stat-row { grid-template-columns: 100px 1fr 58px; gap: 8px; }
    .stat-row-hint { display: block; font-size: 8px; }
    .perf-split { grid-template-columns: 1fr; }
    .perf-split .stats-rows { padding-right: 0; }
    .perf-split .radar-wrap { padding-left: 0; border-left: none; }
    .rating-bar { min-width: 0; }
    .compare-controls { flex-direction: column; align-items: stretch; }
    .compare-controls .form-group { min-width: auto; width: 100%; }
    .results-podium .bar { width: 60px; }
    .results-table-wrap {
        margin: 0 -24px;
        padding: 0;
        border-left: none;
        border-right: none;
        border-radius: 0;
    }
    .results-table-wrap h2 {
        padding: 20px 20px 16px;
        margin-bottom: 0;
    }
}

/* ========== PRIVACY PAGE ========== */

.privacy-page {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 24px;
}

.privacy-page h1 {
    font-size: 32px;
    color: var(--text-bright);
    margin-bottom: 8px;
}

.privacy-page .updated {
    color: var(--text-muted);
    font-size: 13px;
    margin-bottom: 32px;
}

.privacy-page h2 {
    font-size: 20px;
    color: var(--accent);
    margin: 28px 0 12px;
}

.privacy-page p {
    font-size: 14px;
    line-height: 1.8;
    color: var(--text);
    margin-bottom: 12px;
}

.privacy-page ul {
    margin: 8px 0 16px 20px;
    list-style: disc;
}

.privacy-page li {
    font-size: 14px;
    line-height: 1.7;
    color: var(--text);
    margin-bottom: 4px;
}

.privacy-page .back-link {
    display: inline-block;
    margin-bottom: 24px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 14px;
}

.privacy-page .back-link:hover { color: var(--accent); }

/* Rate-limit toast */
.rate-toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 9999;
    background: rgba(18, 18, 22, .94);
    color: #fff;
    padding: 14px 22px;
    border-radius: 10px;
    font-size: 14px;
    border: 1px solid rgba(255, 215, 0, .45);
    box-shadow: 0 10px 34px rgba(0, 0, 0, .5);
    max-width: 92vw;
    text-align: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease, transform .2s ease;
    white-space: nowrap;
}

.rate-toast.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

@media (max-width: 600px) {
    .rate-toast { white-space: normal; }
}

/* ==================== RECORDS TAB ==================== */
.records-header-card {
    background: linear-gradient(135deg, rgba(198,40,40,0.18) 0%, rgba(26,15,15,0.6) 60%);
    border: 1px solid var(--border);
}
.records-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}
.records-header-row h2 {
    margin-bottom: 4px;
    font-size: 22px;
    background: linear-gradient(90deg, var(--accent), #ffb74d);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.records-refresh-badge {
    font-size: 12px;
    font-weight: 600;
    color: var(--gold);
    background: rgba(255, 215, 0, 0.08);
    border: 1px solid rgba(255, 215, 0, 0.25);
    border-radius: 999px;
    padding: 6px 14px;
    white-space: nowrap;
}
.records-controls { margin: 16px 0 0; }
.records-controls .form-group { min-width: 160px; }
.records-hint { margin-top: 8px; }
.records-building {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: 48px 20px;
    text-align: center;
}
.records-building-title { font-size: 16px; color: var(--text-bright); font-weight: 700; }
.records-progress {
    width: min(420px, 90%);
    height: 8px;
    border-radius: 999px;
    background: var(--bg-input);
    overflow: hidden;
}
.records-progress-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    transition: width .4s ease;
}
.records-progress-text { font-size: 13px; color: var(--text-muted); }

.record-card { padding: 18px 20px; }
.record-title {
    font-size: 15px;
    color: var(--text-bright);
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
    letter-spacing: .3px;
}
.record-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}
.record-col { min-width: 0; }
.record-col-head {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 10px;
}
.record-col-head.best { color: #4caf50; }
.record-col-head.worst { color: #f44336; }

.record-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px;
    border-radius: 10px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    margin-bottom: 8px;
    transition: transform .12s ease, border-color .12s ease;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}
.record-item,
.record-item * {
    cursor: pointer;
}
.record-item:hover { transform: translateX(3px); border-color: var(--accent); }
.record-item-gold {
    border-color: rgba(255, 215, 0, 0.4);
    background: linear-gradient(135deg, rgba(255,215,0,0.08), var(--bg-input));
}
.record-thumb {
    position: relative;
    width: 84px;
    height: 50px;
    flex-shrink: 0;
    border-radius: 8px;
    background-size: cover;
    background-position: center;
    overflow: hidden;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.06);
}
.record-thumb::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0,0,0,0.15), rgba(0,0,0,0.55));
}
.record-rank {
    position: absolute;
    top: 3px;
    left: 5px;
    z-index: 2;
    font-size: 13px;
    font-weight: 900;
    color: #fff;
    text-shadow: 0 1px 3px rgba(0,0,0,.9);
}
.record-result {
    position: absolute;
    bottom: 3px;
    right: 5px;
    z-index: 2;
    font-size: 8px;
    font-weight: 800;
    letter-spacing: .5px;
    padding: 1px 5px;
    border-radius: 4px;
}
.record-result.win { background: rgba(76,175,80,.85); color: #fff; }
.record-result.loss { background: rgba(244,67,54,.85); color: #fff; }
.record-body { min-width: 0; flex: 1; }
.record-value {
    font-size: 20px;
    font-weight: 800;
    color: var(--text-bright);
    line-height: 1.1;
}
.record-meta {
    display: flex;
    gap: 8px;
    align-items: center;
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}
.record-map { font-weight: 700; color: var(--accent); }
.record-score { color: var(--text); }
.record-duration {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-bright);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 0 5px;
}
.record-holders {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 6px;
    margin-top: 5px;
}
.record-holder {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    color: var(--text);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 1px 7px 1px 1px;
    max-width: 100%;
}
.record-holder-avatar {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}
.record-holder-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 7px;
    font-weight: 800;
    background: var(--bg-input);
    color: var(--text-muted);
}
.record-holder-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 90px;
}
.records-scope-note {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 12px;
}
.records-scope-note strong { color: var(--accent); }
.record-date { font-size: 10px; color: var(--text-muted); opacity: .7; margin-top: 1px; }
.record-empty {
    font-size: 12px;
    color: var(--text-muted);
    padding: 10px;
    text-align: center;
}

@media (max-width: 820px) {
    .record-grid { grid-template-columns: 1fr; }
}

.records-toggle {
    display: inline-flex;
    gap: 4px;
    padding: 4px;
    margin-bottom: 18px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 999px;
}
.records-toggle-btn {
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
    padding: 8px 18px;
    border-radius: 999px;
    cursor: pointer;
    transition: background .15s, color .15s;
}
.records-toggle-btn:hover { color: var(--text-bright); }
.records-toggle-btn.active {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff;
}
.record-grid.single { grid-template-columns: 1fr; }

.records-building-note {
    font-size: 13px;
    color: var(--text-muted);
    max-width: 420px;
    line-height: 1.5;
}

/* ===== Composite Rating (main parameter) ===== */
.main-rating-wrap {
    margin-bottom: 16px;
    padding: 12px 14px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.015));
    border: 1px solid var(--accent);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
}
.main-rating-wrap .stat-row-label {
    font-weight: 800;
    letter-spacing: .5px;
    color: var(--accent);
}
.main-rating-wrap .stat-row-value {
    font-size: 20px;
    font-weight: 800;
    color: var(--text-bright);
}

tr.main-param-row td {
    background: rgba(255, 255, 255, 0.045);
    font-size: 15px;
}
tr.main-param-row td:first-child strong {
    color: var(--accent);
    font-size: 15px;
}

/* ===== Premium profile hero ===== */
.player-hero.premium {
    position: relative;
    z-index: 2;
    align-items: stretch;
    gap: 24px;
    padding: 0;
    margin-bottom: 0;
    border-radius: 0;
    background: linear-gradient(135deg, rgba(198, 40, 40, 0.16), rgba(26, 15, 15, 0.55));
    border: 1px solid rgba(255, 215, 0, 0.28);
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}
.stats-sections { margin-top: 16px; }
.player-hero.premium::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        repeating-linear-gradient(135deg, rgba(255, 215, 0, 0.06) 0 1px, transparent 1px 13px),
        repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.025) 0 1px, transparent 1px 13px),
        radial-gradient(circle at top right, rgba(255, 215, 0, 0.10), transparent 60%);
    pointer-events: none;
}
.player-hero.premium .info h2 { font-size: 24px; }
.premium-photo-wrap {
    position: relative;
    flex-shrink: 0;
    align-self: stretch;
    width: 155px;
    min-height: 165px;
    border-radius: 0;
    border-right: 1px solid rgba(255, 215, 0, 0.5);
    overflow: hidden;
}
.player-hero.premium .premium-photo {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    border: none;
    border-radius: 0;
    opacity: 0;
    transition: opacity .6s ease;
    -webkit-mask-image: linear-gradient(to bottom, #000 86%, transparent 100%);
    mask-image: linear-gradient(to bottom, #000 86%, transparent 100%);
}
.player-hero.premium .premium-photo.loaded {
    opacity: 1;
}
.premium-badges {
    position: absolute;
    top: 8px;
    left: 8px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    z-index: 2;
}
.player-hero.premium .premium-faceit-link {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.30);
    border: 1px solid rgba(255, 255, 255, 0.12);
    cursor: pointer;
    transition: background .15s ease;
}
.player-hero.premium .premium-faceit-link:hover {
    background: #000;
}
.player-hero.premium .premium-faceit-link img {
    width: 20px;
    height: 20px;
    object-fit: contain;
    border: none;
    border-radius: 0;
    cursor: pointer;
}
.player-hero.premium .premium-flag {
    width: 22.5px;
    height: 15px;
    object-fit: cover;
    border: none;
    border-radius: 0;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}
.player-hero.premium .premium-team-logo {
    width: 22.5px;
    height: 15px;
    object-fit: contain;
    border: none;
    border-radius: 0;
}
.premium-info {
    position: relative;
    min-width: 0;
    width: fit-content;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 12px 18px 12px 22px;
}
.premium-realname {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 6px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(255, 215, 0, 0.20);
}
.premium-rows {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 6px;
}
.premium-row {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    padding-bottom: 5px;
    border-bottom: 1px solid rgba(255, 215, 0, 0.20);
}
.player-hero.premium .premium-info .sub {
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(255, 215, 0, 0.20);
}
.premium-row-label {
    min-width: 74px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .8px;
    text-transform: uppercase;
    color: var(--text-muted);
}
.premium-row-value {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    color: var(--text-bright);
}
.player-hero.premium .premium-team-mini {
    width: 22.5px;
    height: 15px;
    object-fit: contain;
    border: none;
    border-radius: 0;
}
@media (max-width: 560px) {
    .player-hero.premium { gap: 12px; }
    .premium-photo-wrap { width: 104px; min-height: 107px; }
    .player-hero.premium .info h2 { font-size: 16px; }
    .premium-realname { font-size: 11px; margin-bottom: 3px; padding-bottom: 3px; }
    .premium-rows { gap: 2px; margin-bottom: 3px; }
    .premium-row { font-size: 11px; padding-bottom: 3px; }
    .premium-row-label { min-width: 56px; font-size: 8px; }
    .premium-info { padding: 6px 8px 6px 12px; }
    .player-hero.premium .info .sub { font-size: 11px; padding-bottom: 3px; }
    .premium-badges { transform: scale(.67); transform-origin: top left; }
    .player-hero.premium .premium-faceit-link { top: 6px; right: 6px; width: 26px; height: 26px; }
    .player-hero.premium .premium-faceit-link img { width: 16px; height: 16px; }
    .premium-achievements { padding: 4px 8px; gap: 6px; }
    .achievement { width: 32px; height: 32px; padding: 2px; }
    .achievement-place, .achievement-year { font-size: 8px; }
}

/* ===== Premium: performance tabs ===== */
.perf-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--border);
}
.perf-tab {
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    padding: 8px 4px;
    margin-bottom: -1px;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-muted);
    cursor: pointer;
    transition: color .15s ease, border-color .15s ease;
}
.perf-tab:hover { color: var(--text-bright); }
.perf-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.perf-pane { animation: perfPaneIn .25s ease; }
@keyframes perfPaneIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ===== Team MVP (by year) ===== */
.mvp-year-block {
    margin-bottom: 16px;
    padding: 14px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.22);
    border: 1px solid var(--border);
}
.mvp-year-block:last-child { margin-bottom: 0; }
.mvp-year-head {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}
.mvp-year-num {
    font-size: 20px;
    font-weight: 900;
    letter-spacing: 1px;
    color: var(--accent);
}
.mvp-chip-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.mvp-chip-grid-wide { margin-bottom: 8px; }
.mvp-chip {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 96px;
    padding: 6px 10px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border);
}
.mvp-chip-label {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--text-muted);
}
.mvp-chip-value { display: flex; align-items: center; gap: 6px; min-width: 0; }
.mvp-chip-avatar {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    object-fit: cover;
    object-position: center top;
    flex-shrink: 0;
}
.mvp-chip-avatar-q {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-input);
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 800;
}
.mvp-chip-name {
    font-size: 13px;
    font-weight: 800;
    color: var(--text-bright);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.mvp-chip-empty .mvp-chip-name { color: var(--text-muted); }
.mvp-chip-mine {
    background-image: repeating-linear-gradient(45deg, rgba(255, 215, 0, 0.16) 0 5px, transparent 5px 10px);
    border-color: rgba(255, 215, 0, 0.55);
}
.mvp-chip-year {
    border-color: rgba(255, 215, 0, 0.4);
    background: rgba(255, 215, 0, 0.06);
}
.mvp-chip-grid-months {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}
.mvp-chip-grid-months .mvp-chip { min-width: 0; padding: 5px 8px; }
.mvp-chip-grid-months .mvp-chip-name { font-size: 12px; }
@media (max-width: 720px) {
    .mvp-chip-grid-months { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 560px) {
    .mvp-chip { min-width: 0; padding: 5px 8px; }
    .mvp-chip-label { font-size: 8px; }
    .mvp-chip-name { font-size: 11px; }
    .mvp-chip-grid-months .mvp-chip-name { font-size: 10px; }
    .mvp-chip-avatar { width: 15px; height: 15px; }
    .mvp-year-num { font-size: 17px; }
}

/* ===== Premium achievements ===== */
.premium-achievements {
    position: relative;
    z-index: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
    padding: 5px 10px;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.06), rgba(0, 0, 0, 0.25));
    border: 1px solid rgba(255, 215, 0, 0.18);
    border-top: none;
}
.premium-achievements:empty { display: none; }
.achievement {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 2px;
    border-radius: 7px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border);
}
.achievement img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}
.achievement-place,
.achievement-year {
    position: absolute;
    font-size: 10px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: .2px;
    color: var(--text-muted);
}
.achievement-place { top: 3px; left: 4px; }
.achievement-year { bottom: 3px; right: 4px; }
.achievement.place-1 { border-color: rgba(255, 215, 0, 0.5); }
.achievement.place-1 .achievement-place,
.achievement.place-1 .achievement-year { color: #ffd700; }
.achievement.place-2 { border-color: rgba(207, 212, 216, 0.5); }
.achievement.place-2 .achievement-place,
.achievement.place-2 .achievement-year { color: #cfd4d8; }
.achievement.place-3 { border-color: rgba(205, 127, 50, 0.5); }
.achievement.place-3 .achievement-place,
.achievement.place-3 .achievement-year { color: #cd7f32; }

/* ===== Map win rate (Records) ===== */
.map-winrate-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
}
.map-winrate-item { min-width: 0; }
.map-winrate-thumb {
    position: relative;
    height: 70px;
    border-radius: 8px;
    background-size: cover;
    background-position: center;
    overflow: hidden;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}
.map-winrate-thumb::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.15), rgba(0, 0, 0, 0.6));
}
.map-winrate-pct {
    position: absolute;
    bottom: 5px;
    right: 7px;
    z-index: 2;
    font-size: 18px;
    font-weight: 900;
    color: #fff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
}
.map-winrate-name {
    margin-top: 6px;
    font-size: 12px;
    font-weight: 800;
    color: var(--accent);
    text-align: center;
}
.map-winrate-sub {
    font-size: 11px;
    color: var(--text-muted);
    text-align: center;
}

/* ===== Big clutches (1v3/1v4/1v5 wins) ===== */
.clutch-big {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-top: 14px;
}
.clutch-big-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 12px;
    border-radius: 10px;
    background: rgba(255, 215, 0, 0.06);
    border: 1px solid rgba(255, 215, 0, 0.2);
}
.clutch-big-value {
    font-size: 26px;
    font-weight: 900;
    line-height: 1;
    color: #ffd700;
}
.clutch-big-label {
    font-size: 11px;
    color: var(--text-muted);
    text-align: center;
}

/* ===== Compact period selector inside the premium "Показатели" tab ===== */
.perf-pane #statsPeriodCard {
    background: none !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 0 14px !important;
    box-shadow: none !important;
}
.perf-pane #statsPeriodCard .section-divider,
.perf-pane #statsPeriodCard .section-note { display: none !important; }
.perf-pane #statsPeriodCard .form-group { min-width: 108px !important; }
.perf-pane #statsPeriodCard select,
.perf-pane #statsPeriodCard input { width: auto !important; }
.perf-pane #statsPeriodCard #statsLoadBtn { padding: 6px 14px !important; }
.perf-pane #statsPeriodCard select {
    height: 30px;
    padding: 0 8px;
    font-size: 12px;
    line-height: 28px;
}
.perf-pane #statsPeriodCard .form-group { min-width: 92px !important; }
.perf-pane #statsPeriodCard input[type="date"] {
    height: 30px;
    padding: 0 8px;
    font-size: 12px;
    width: 132px;
}
.perf-pane #statsPeriodCard #statsCustomDates .form-group,
.perf-pane #statsPeriodCard #statsCalMonth .form-group,
.perf-pane #statsPeriodCard #statsCalSeason .form-group,
.perf-pane #statsPeriodCard #statsCalYear .form-group {
    min-width: 0 !important;
}
.perf-pane #statsPeriodCard .form-group label {
    font-size: 11px;
}
