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




:root {

    --bg-body: #0a0a12;
    --bg-primary: #0f0f1a;
    --bg-secondary: #141425;
    --bg-card: rgba(255, 255, 255, 0.04);
    --bg-card-hover: rgba(255, 255, 255, 0.07);
    --bg-card-solid: #181828;
    --bg-input: rgba(255, 255, 255, 0.05);


    --accent: #ff5500;
    --accent-hover: #ff6b1a;
    --accent-dim: rgba(255, 85, 0, 0.08);


    --text-primary: #f0f0f5;
    --text-secondary: #8888aa;
    --text-muted: #55556a;


    --success: #3dff6c;
    --success-glow: rgba(61, 255, 108, 0.2);
    --danger: #ff2b2b;
    --danger-glow: rgba(255, 43, 43, 0.2);
    --warning: #ffc800;


    --border: rgba(255, 255, 255, 0.08);
    --border-accent: rgba(255, 85, 0, 0.4);


    --radius-sm: 2px;
    --radius: 3px;
    --radius-lg: 4px;
    --radius-xl: 4px;


    --shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.3);


    --transition: all 0.15s ease;
}

/* ═══════ Collapsible Accordion Sections ═══════ */
.section-toggle-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    user-select: none;
    padding: 0;
}

.section-toggle-header::after {
    content: '▾';
    font-size: 0.75rem;
    color: var(--text-muted);
    transition: transform 0.2s ease;
    margin-left: 8px;
    flex-shrink: 0;
}

.section-collapsed .section-toggle-header::after {
    transform: rotate(-90deg);
}

.section-toggle-body {
    max-height: 3000px;
    overflow: hidden;
    transition: max-height 0.35s ease, opacity 0.25s ease;
    opacity: 1;
}

.section-collapsed .section-toggle-body {
    max-height: 0;
    opacity: 0;
}

/* ═══════ Compare: Score & Winner ═══════ */
.compare-score-row {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.03);
    border-top: 1px solid var(--border);
    padding: 0;
}

.compare-score-val {
    flex: 1;
    text-align: center;
    padding: 14px 16px;
    font-size: 1.4rem;
    font-weight: 900;
    font-variant-numeric: tabular-nums;
}

.compare-score-label {
    width: 120px;
    flex-shrink: 0;
    text-align: center;
    padding: 14px 8px;
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
    border-left: 1px solid rgba(255,255,255,0.04);
    border-right: 1px solid rgba(255,255,255,0.04);
}

.compare-winner-banner {
    text-align: center;
    padding: 20px 24px;
    background: linear-gradient(135deg, rgba(255,85,0,0.12) 0%, rgba(255,85,0,0.04) 100%);
    border-top: 1px solid rgba(255,85,0,0.25);
}

.compare-winner-title {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 8px;
}

.compare-winner-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.compare-winner-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--accent);
    object-fit: cover;
}

.compare-winner-name {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--accent);
}

.compare-winner-score {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-top: 4px;
}

.compare-draw-banner {
    text-align: center;
    padding: 18px 24px;
    background: rgba(255, 255, 255, 0.03);
    border-top: 1px solid var(--border);
}

.compare-draw-text {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-secondary);
}


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


body {
    font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }


.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    height: 64px;
    background: rgba(10, 10, 18, 0.95);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.3px;
}

.logo-icon {
    font-size: 1.4rem;
    display: inline-block;
}

.nav-link {
    position: relative;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    letter-spacing: 0.2px;
}

.nav-link.active {
    color: var(--text-primary);
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-user-menu {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-username {
    color: var(--accent);
    font-weight: 700;
    font-size: 0.9rem;
    text-decoration: none;
    cursor: pointer;
}


.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 20px;
    border: none;
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    letter-spacing: 0.2px;
    position: relative;
}

.btn-primary {
    background: var(--accent);
    color: white;
}

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


.btn-sm { padding: 5px 14px; font-size: 0.8rem; line-height: 1.4; }
.btn-full { width: 100%; }


.main-container {
    flex: 1;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 2rem;
}


.hero {
    text-align: center;
    padding: 5rem 0 2.5rem;
    animation: fadeInUp 0.6s ease both;
}

.hero h1 {
    font-size: 3.5rem;
    font-weight: 900;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
    letter-spacing: -1.5px;
    line-height: 1.1;
}

.hero-subtitle {
    color: var(--text-secondary);
    font-size: 1.05rem;
    margin-bottom: 2.5rem;
    font-weight: 400;
}

.search-box {
    display: flex;
    max-width: 700px;
    margin: 0 auto;
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--bg-card-solid);
}

.search-box:focus-within {
    border-color: var(--border-accent);
}

.search-input {
    flex: 1;
    padding: 16px 20px;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    outline: none;
}

.search-input::placeholder { color: var(--text-muted); }

.search-btn {
    padding: 0 28px;
    border-radius: 0;
    font-size: 0.95rem;
    border-left: 1px solid var(--border);
}

.search-hints {
    margin-top: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.search-hints .hint {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.search-hints code {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border);
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    color: var(--text-secondary);
    font-family: 'Fira Code', 'Cascadia Code', monospace;
}


.results-section { margin-top: 2rem; }

.result-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    margin-bottom: 10px;
    cursor: pointer;
}

.result-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border);
}

.result-info { flex: 1; min-width: 0; }

.result-nickname {
    font-size: 1.05rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.result-meta {
    color: var(--text-secondary);
    font-size: 0.82rem;
    margin-top: 2px;
}

.result-elo {
    font-size: 1.15rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.result-badge {
    background: var(--accent);
    color: white;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 700;
    margin-left: 8px;
    letter-spacing: 0.3px;
}


.profile-header {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 16px 20px;
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border);
    margin-bottom: 0.5rem;
    position: relative;
}

.profile-avatar-wrapper {
    position: relative;
    flex-shrink: 0;
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 2px solid var(--border);
    object-fit: cover;
}

.profile-badge {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 22px;
    height: 22px;
    background: var(--accent);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    border: 2px solid var(--bg-body);
    cursor: help;
    z-index: 2;
}

.profile-info { flex: 1; min-width: 0; }

.profile-nickname {
    font-size: 1.6rem;
    font-weight: 900;
    letter-spacing: -0.5px;
    line-height: 1.1;
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.profile-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.profile-right-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.profile-stats-summary {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}


.stat-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    min-width: 56px;
    cursor: default;
}


.stat-label {
    font-size: 0.55rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
    margin-bottom: 1px;
}

.stat-value {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

.elo-value, .level-value { color: var(--accent); }

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
    margin-top: 16px;
}


.performance-charts-section {
    margin-bottom: 0.5rem;
    padding: 14px 18px;
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border);
}

.performance-charts-section h2 {
    margin-bottom: 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

.performance-charts-section .section-toggle-body {
    margin-top: 12px;
}

.charts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.chart-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    padding: 12px;
}

.chart-card h3 {
    font-size: 0.78rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    margin-bottom: 8px;
}

.chart-container {
    position: relative;
    height: 220px;
}

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


.match-history-section {
    padding: 14px 18px;
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border);
}

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

.history-header h2 {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

.history-controls {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.filter-select {
    padding: 6px 12px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 0.82rem;
    cursor: pointer;
    outline: none;
    color-scheme: dark;
}

.filter-select option {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.guest-notice {
    padding: 14px 18px;
    background: rgba(255, 85, 0, 0.07);
    border: 1px solid rgba(255, 85, 0, 0.3);
    border-radius: var(--radius-lg);
    margin-bottom: 16px;
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.guest-notice a { font-weight: 600; }

/* Loading banner for incremental match loading */
.loading-banner {
    padding: 14px 18px;
    background: rgba(59, 130, 246, 0.08);
    border: 1px solid rgba(59, 130, 246, 0.25);
    border-radius: var(--radius-lg);
    margin-bottom: 16px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.loading-banner-text {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.loading-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(59, 130, 246, 0.3);
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    flex-shrink: 0;
}

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

.loading-progress-bar {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 2px;
    overflow: hidden;
}

.loading-progress-fill {
    height: 100%;
    background: #3b82f6;
    border-radius: 2px;
    transition: width 0.3s ease;
    width: 0%;
    animation: progress-pulse 2s ease-in-out infinite;
}

@keyframes progress-pulse {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}


.match-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}

.match-table th {
    text-align: left;
    padding: 7px 10px;
    color: var(--text-muted);
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.match-table td {
    padding: 6px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    font-variant-numeric: tabular-nums;
}

.match-table tbody tr {
}

.match-row-win {
    border-left: 3px solid var(--success);
}

.match-row-loss {
    border-left: 3px solid var(--danger);
}

.result-win {
    color: var(--success);
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.result-loss {
    color: var(--danger);
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-good { color: var(--success); font-weight: 600; }
.stat-bad { color: var(--danger); }
.stat-neutral { color: var(--warning); }

/* Match table — number column */
.match-num {
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    min-width: 30px;
    text-align: center;
}

/* Match table — map cell with icon */
.match-map-cell {
    white-space: nowrap;
}

.match-map-icon {
    width: 20px;
    height: 20px;
    object-fit: cover;
    border-radius: 2px;
    vertical-align: middle;
    margin-right: 6px;
}

.match-map-name {
    font-weight: 600;
    font-size: 0.82rem;
    vertical-align: middle;
}

/* Match table — date cell */
.match-date-cell {
    white-space: nowrap;
    line-height: 1.3;
}

.match-time {
    color: var(--text-muted);
    font-size: 0.72rem;
}


.pagination {
    display: flex;
    justify-content: center;
    gap: 4px;
    margin: 8px 0;
}

.pagination button {
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 0.78rem;
    cursor: pointer;
}

.pagination button.active {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}


.period-stats {
    margin-bottom: 10px;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}

.period-stats h3 {
    display: none;
}

.period-stats-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.period-stats-title {
    font-size: 0.68rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
}

.period-info-badge {
    padding: 2px 8px;
    font-size: 0.62rem;
    color: var(--text-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-card);
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.period-stats-cards {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.period-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    min-width: 72px;
    flex: 1;
}

.period-card-label {
    font-size: 0.6rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-weight: 600;
    margin-bottom: 2px;
    white-space: nowrap;
}

.period-card-value {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}


.loading-overlay {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: 4rem 0;
}

.spinner {
    width: 38px;
    height: 38px;
    border: 3px solid rgba(255, 85, 0, 0.15);
    border-top: 3px solid var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.loading-text {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
    font-size: 1rem;
}

.error-message {
    text-align: center;
    padding: 16px;
    color: var(--danger);
    font-size: 0.9rem;
    background: rgba(255, 43, 43, 0.06);
    border: 1px solid rgba(255, 43, 43, 0.2);
    border-radius: var(--radius-lg);
    margin-top: 12px;
}


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


.page-title {
    text-align: center;
    font-size: 2rem;
    font-weight: 900;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.page-subtitle {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    font-size: 0.95rem;
}

.compare-inputs {
    display: flex;
    align-items: center;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.compare-field .search-input {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 16px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.compare-field .search-input:focus {
    border-color: var(--border-accent);
    box-shadow: 0 0 0 3px rgba(255, 85, 0, 0.1);
}

.compare-field .search-input::placeholder {
    color: var(--text-muted);
}

.compare-field label {
    display: block;
    color: var(--text-muted);
    margin-bottom: 8px;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

.compare-vs {
    font-size: 1.3rem;
    font-weight: 900;
    color: var(--accent);
    padding-bottom: 0;
    margin-top: 20px;
    letter-spacing: 2px;
    flex-shrink: 0;
}

.compare-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.compare-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 24px;
}

.compare-player-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.compare-avatar {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border);
}

.compare-player-info h3 {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.compare-player-info h3 a { color: var(--text-primary); }

.elo-badge {
    font-weight: 700;
    font-size: 0.875rem;
}


.stats-compare-table {
    width: 100%;
    border-collapse: collapse;
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--bg-card);
}

.stats-compare-table th,
.stats-compare-table td {
    padding: 12px 18px;
    text-align: center;
    border-bottom: 1px solid var(--border);
}

.stats-compare-table th {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.72rem;
    letter-spacing: 1px;
}

.stats-compare-table td:first-child {
    text-align: left;
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.stats-compare-table tbody tr {
}

.stat-better {
    color: var(--success) !important;
    font-weight: 800;
}

.stat-worse {
    color: var(--danger) !important;
    opacity: 0.8;
}

/* Compare — unified container */
.compare-result-container {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    overflow: hidden;
    margin-top: 32px;
}

.compare-header-row {
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--border);
}

.compare-header-player {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 18px 16px;
}

.compare-header-player img.compare-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border);
}

.compare-header-player .country-flag-img {
    width: 24px;
    height: 18px;
    border-radius: 2px;
    object-fit: cover;
    border: none;
}

.compare-header-player .compare-h-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
}

.compare-header-player .compare-h-elo {
    font-size: 0.85rem;
    font-weight: 600;
}

.compare-header-sep {
    width: 1px;
    align-self: stretch;
    background: var(--border);
}

.compare-stats-body {
    display: flex;
    flex-direction: column;
}

.compare-stat-row {
    display: flex;
    align-items: center;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}

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

.compare-stat-val {
    flex: 1;
    text-align: center;
    padding: 8px 12px;
    font-size: 0.9rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.compare-stat-label {
    width: 120px;
    flex-shrink: 0;
    text-align: center;
    padding: 8px 6px;
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-weight: 600;
    border-left: 1px solid rgba(255,255,255,0.04);
    border-right: 1px solid rgba(255,255,255,0.04);
}

.compare-match-count-select {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 14px;
}

.compare-match-count-select label {
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 500;
}

/* Game selector for profile */
.game-selector-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.game-selector-wrap label {
    color: var(--text-muted);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-weight: 600;
}



.rank-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 1.5rem;
}

.rank-card {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 16px 24px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}

.rank-card.rank-1 { border-color: rgba(255, 215, 0, 0.4); }
.rank-card.rank-2 { border-color: rgba(192, 192, 192, 0.35); }
.rank-card.rank-3 { border-color: rgba(205, 127, 50, 0.35); }

.rank-number {
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--text-muted);
    min-width: 36px;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.rank-card.rank-1 .rank-number { color: #ffd700; }
.rank-card.rank-2 .rank-number { color: #c0c0c0; }
.rank-card.rank-3 .rank-number { color: #cd7f32; }

.rank-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border);
    flex-shrink: 0;
}

.rank-card.rank-1 .rank-avatar { border-color: rgba(255, 215, 0, 0.5); }
.rank-card.rank-2 .rank-avatar { border-color: rgba(192, 192, 192, 0.4); }
.rank-card.rank-3 .rank-avatar { border-color: rgba(205, 127, 50, 0.4); }

.rank-info {
    flex: 1;
    min-width: 0;
}

.rank-nickname {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-decoration: none;
    display: block;
}


.rank-elo {
    font-size: 1.15rem;
    font-weight: 800;
    margin-left: auto;
    font-variant-numeric: tabular-nums;
}

.rank-level {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-left: 12px;
    min-width: 50px;
    text-align: right;
}


.mini-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    vertical-align: middle;
    margin-right: 8px;
    border: 1px solid var(--border);
}

.player-link {
    color: var(--text-primary);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}


/* Faceit icon in buttons and logo */
.logo-icon-img {
    width: 22px;
    height: 18px;
    vertical-align: middle;
}

.btn-faceit-icon {
    width: 16px;
    height: 13px;
    vertical-align: middle;
}

/* Country flag — using img from flagcdn */
.country-flag {
    font-size: 1.3rem;
    vertical-align: middle;
    line-height: 1;
}

.country-flag-img {
    width: 24px;
    height: 18px;
    vertical-align: middle;
    border-radius: 2px;
    object-fit: cover;
}

.profile-country {
    font-size: 1rem;
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* App layout — main only, sidebar is fixed */
.app-layout {
    display: flex;
    flex: 1;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
}

.app-layout .main-container {
    flex: 1;
    max-width: none;
    margin: 0;
}

/* History sidebar — fixed right, doesn't shift content */
.history-sidebar {
    position: fixed;
    right: 0;
    top: 64px;
    width: 260px;
    height: calc(100vh - 64px);
    padding: 1rem 0.75rem;
    border-left: 1px solid var(--border);
    background: var(--bg-body);
    overflow-y: auto;
    z-index: 100;
}

.history-title {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
    margin-bottom: 12px;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.history-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: var(--radius);
    color: var(--text-secondary);
    font-size: 0.78rem;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
}

.history-icon {
    flex-shrink: 0;
    font-size: 0.85rem;
}

.history-text {
    overflow: hidden;
    text-overflow: ellipsis;
}

.history-empty {
    color: var(--text-muted);
    font-size: 0.78rem;
    padding: 8px;
}

/* Game toggle wrapper — above profile container, right-aligned */
.profile-game-toggle-wrap {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 6px;
}

/* Game toggle buttons (CS2/CS:GO) — horizontal, clean */
.game-toggle {
    display: inline-flex;
    flex-direction: row;
    align-items: stretch;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    flex-shrink: 0;
}

.game-toggle-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 7px 18px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    opacity: 0.45;
    transition: opacity 0.15s, background 0.15s;
    min-width: 80px;
}

.game-toggle-btn.active {
    background: rgba(255, 255, 255, 0.07);
    color: var(--text-primary);
    opacity: 1;
}

.game-toggle-sep {
    width: 1px;
    align-self: stretch;
    background: var(--border);
}

.game-toggle-icon {
    width: 18px;
    height: 18px;
    object-fit: contain;
}

/* Quick stats period badge — compact inside profile header */
.quick-stats-period-badge {
    display: inline-block;
    padding: 3px 10px;
    font-size: 0.65rem;
    color: var(--text-muted);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: transparent;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    font-weight: 600;
}


/* ═══════ Leetify Analytics Section ═══════ */
.leetify-section {
    padding: 14px 18px;
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border);
    margin-bottom: 0.5rem;
}

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

.leetify-section .section-toggle-body {
    margin-top: 8px;
}

.leetify-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.leetify-header-right-area {
    display: flex;
    align-items: center;
    gap: 10px;
}

.leetify-logo-link {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.leetify-logo-img {
    height: 22px;
    width: auto;
    object-fit: contain;
}

.leetify-provided-text {
    font-size: 0.55rem;
    color: var(--text-muted);
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.leetify-view-link {
    color: #F84982;
    font-size: 0.7rem;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
    flex-shrink: 0;
}

.leetify-view-link:hover {
    color: #ff6fa0;
}

.leetify-grid {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.leetify-group {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.leetify-group-title {
    font-size: 0.55rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

.leetify-stats-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 4px;
}

.leetify-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    padding: 6px 8px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius);
    border: 1px solid rgba(255, 255, 255, 0.06);
    width: 96px;
    height: 52px;
    flex: 0 0 auto;
}

.leetify-stat.leetify-stat-featured {
    padding: 9px 12px;
    width: 170px;
    height: 76px;
}

.leetify-stat-label {
    font-size: 0.48rem;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    font-weight: 600;
    margin-bottom: 2px;
    text-align: center;
    line-height: 1.12;
}

.leetify-stat-value {
    font-size: 0.82rem;
    font-weight: 800;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

.leetify-stat-featured .leetify-stat-label {
    font-size: 0.72rem;
    margin-bottom: 6px;
}

.leetify-stat-featured .leetify-stat-value {
    font-size: 1.35rem;
}

.leetify-bans {
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.leetify-ban {
    font-size: 0.7rem;
    color: var(--danger);
    padding: 3px 8px;
    background: rgba(255, 0, 43, 0.08);
    border-radius: var(--radius);
    border: 1px solid rgba(255, 0, 43, 0.15);
}

.leetify-unavailable {
    color: var(--text-muted);
    font-size: 0.75rem;
    padding: 8px 0;
    text-align: center;
}

/* Map stats section */
.map-stats-section {
    padding: 14px 18px;
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border);
    margin-bottom: 0.5rem;
}

.map-stats-section h2 {
    margin-bottom: 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

.map-stats-section .section-toggle-body {
    margin-top: 12px;
}

.map-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
    justify-items: center;
}

.map-stat-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    background: var(--bg-card);
    width: 100%;
    max-width: 220px;
}

.map-stat-card.map-inactive .map-stat-name {
    color: var(--text-muted);
}

.map-stat-img {
    width: 64px;
    height: 64px;
    object-fit: contain;
    opacity: 0.85;
}
.map-stat-name {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: center;
}

.map-not-in-pool {
    font-size: 0.65rem;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: none;
    letter-spacing: 0;
}

.map-stat-count {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.map-stat-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px 12px;
    width: 100%;
}

.map-stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.78rem;
}

.map-stat-lbl {
    color: var(--text-muted);
    font-weight: 500;
}

.map-stat-val {
    font-weight: 700;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}


/* History avatar */
.history-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--border);
    flex-shrink: 0;
}

/* History compare layout */
.history-compare-item {
    gap: 4px;
}

.history-nick {
    max-width: 60px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex-shrink: 1;
    min-width: 0;
}

.history-vs {
    color: var(--accent);
    font-weight: 700;
    font-size: 0.68rem;
    flex-shrink: 0;
}

/* Steam preview card on search page */
.steam-preview-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}

.steam-preview-avatar {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-lg);
    object-fit: cover;
    border: 2px solid var(--border);
    flex-shrink: 0;
}

.steam-preview-info {
    flex: 1;
    min-width: 0;
}

.steam-preview-name {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
}

.steam-preview-id {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 2px;
    font-family: 'Fira Code', 'Cascadia Code', monospace;
}


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

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-16px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}



@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}


.hidden { display: none !important; }


@media (max-width: 1024px) {
    .main-container { max-width: 100%; }
}

@media (max-width: 768px) {
    .navbar { padding: 0 1rem; height: 56px; }
    .nav-link { display: none; }

    .hero { padding: 3rem 0 1.5rem; }
    .hero h1 { font-size: 2.4rem; letter-spacing: -0.5px; }

    .search-box { flex-direction: column; border-radius: var(--radius-lg); }
    .search-input { border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
    .search-btn {
        border-radius: 0 0 var(--radius-lg) var(--radius-lg);
        border-left: none;
        border-top: 1px solid var(--border);
        padding: 14px;
    }

    .profile-header {
        flex-direction: column;
        text-align: center;
        padding: 24px 20px;
    }
    .profile-right-panel { width: 100%; }
    .profile-stats-summary { justify-content: center; flex-wrap: wrap; }
    .profile-meta { justify-content: center; }
    .profile-nickname { font-size: 1.5rem; }

    .history-header { flex-direction: column; align-items: flex-start; }
    .history-controls { width: 100%; }
    .filter-select { flex: 1; }

    .match-table { font-size: 0.78rem; }
    .match-table th, .match-table td { padding: 8px 8px; }

    .compare-grid { grid-template-columns: 1fr; }
    .compare-inputs { flex-direction: column; align-items: stretch; }
    .compare-field { max-width: 100%; }
    .compare-vs { padding-bottom: 0; text-align: center; }
    .compare-stat-label { width: 80px; font-size: 0.7rem; }

    .main-container { padding: 1rem; }

    .page-title { font-size: 1.5rem; }

    .history-sidebar { display: none; }
}

@media (max-width: 480px) {
    .hero h1 { font-size: 1.9rem; }
    .profile-avatar { width: 80px; height: 80px; }
    .match-table th:nth-child(n+10) { display: none; }
    .match-table td:nth-child(n+10) { display: none; }
    .rank-card { gap: 12px; padding: 14px 16px; }
    .rank-number { font-size: 1.2rem; min-width: 28px; }
}

/* ═══════ Promo Blocks ═══════ */

.promo-block {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 8px 0;
    padding: 12px 18px;
    border: 1px dashed rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, rgba(255, 85, 0, 0.03) 0%, rgba(255, 255, 255, 0.01) 100%);
    min-height: 70px;
    overflow: hidden;
}

.promo-block::before {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        -45deg,
        transparent,
        transparent 10px,
        rgba(255, 255, 255, 0.008) 10px,
        rgba(255, 255, 255, 0.008) 20px
    );
    pointer-events: none;
}

.promo-block-content {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    text-align: center;
    z-index: 1;
}

.promo-block-label {
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-muted);
    font-weight: 600;
}

.promo-block-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.promo-block-cta {
    font-size: 0.7rem;
    color: var(--accent);
    letter-spacing: 0.5px;
    opacity: 0.7;
}

/* Wide horizontal block */
.promo-block--wide {
    min-height: 90px;
    padding: 22px 32px;
}

/* Compact block between sections */
.promo-block--compact {
    min-height: 50px;
    padding: 12px 20px;
    margin: 12px 0;
}

.promo-block--compact .promo-block-text {
    font-size: 0.78rem;
}

@media (max-width: 768px) {
    .promo-block { padding: 14px 16px; min-height: 56px; }
    .promo-block--wide { min-height: 64px; }
}
