/* Import Poppins font */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700;800&display=swap');

/* ===================================
   Leetify-Style Match Card Components
   =================================== */

/* Match Card Container - Fixed Width Leetify Style */
.match-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 0;
    cursor: pointer;
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
    width: 550px;
    /* Fixed width */
    margin: 0 auto var(--spacing-lg);
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.match-card:hover {
    border-color: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.match-card-disabled {
    cursor: not-allowed;
    opacity: 0.92;
}

.match-card-disabled:hover {
    border-color: var(--border-color);
    transform: none;
    box-shadow: none;
}

/* Leetify Header */
.leetify-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: 12px var(--spacing-lg);
    background: rgba(20, 24, 36, 0.6);
    border-bottom: 1px solid var(--border-color);
}

.game-icon-small {
    width: 23px;
    height: 23px;
    border-radius: 4px;
    object-fit: cover;
}

.result-badge {
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.result-badge.win {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.result-badge.loss {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.result-badge.remake {
    background: rgba(156, 163, 175, 0.15);
    color: #9ca3af;
}

.match-date {
    margin-left: auto;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 500;
}

/* User Section - Support Multiple Users */
.leetify-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px var(--spacing-lg);
    background: rgba(30, 35, 50, 0.6);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.leetify-user.multi-user {
    padding: 0;
}

.user-switcher {
    display: flex;
    gap: 0;
    width: 100%;
    height: 100%;
}

.user-button {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px var(--spacing-lg);
    background: transparent;
    border: none;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-muted);
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    justify-content: flex-start;
}

.user-button:last-child {
    border-right: none;
}

.user-button:hover {
    background: rgba(255, 255, 255, 0.03);
}

.user-button.active {
    color: var(--text-primary);
}

.user-button:not(.active) {
    opacity: 0.5;
}

.user-button-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.user-button-text {
    display: flex;
    align-items: center;
    gap: 6px;
    overflow: hidden;
    flex-wrap: wrap;
    min-width: 0;
}

.user-button-name {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-button-tag {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 11px;
    font-weight: 400;
    color: var(--text-muted);
    white-space: nowrap;
}

.user-highlight-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 18px;
    padding: 0 6px;
    border-radius: 4px;
    font-size: 11px;
    line-height: 1;
    background: rgba(245, 158, 11, 0.16);
    color: #fbbf24;
    border: 1px solid rgba(251, 191, 36, 0.35);
    font-weight: 600;
    vertical-align: middle;
}

.user-avatar-small {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
    cursor: pointer;
    transition: all 0.2s;
}

.user-avatar-small:hover {
    transform: scale(1.05);
    filter: brightness(1.1);
}

.user-avatar-small.active {
    box-shadow: 0 0 0 2px var(--accent-color);
}

.user-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.cs2-feed-rank-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-left: 4px;
    line-height: 1;
}

.cs2-feed-rank-wrap .cs2-premier-rating__label-large {
    transform: translateY(0);
}

.user-avatar-small {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
    cursor: pointer;
    transition: all 0.2s;
}

.user-avatar-small:hover {
    transform: scale(1.05);
    filter: brightness(1.1);
}

.user-avatar-small.active {
    box-shadow: 0 0 0 2px var(--accent-color);
}

.user-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

/* Main Content Area */
.leetify-content {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 16px;
    padding: 16px;
    background: rgba(20, 24, 36, 0.3);
}

/* Champion Panel with Vignette Effect */
.champion-panel {
    position: relative;
    padding: 18px;
    border-radius: 8px;
    background-size: 110%;
    /* Slightly zoomed for better crop */
    background-position: center 20%;
    /* Higher crop to show heads */
    min-height: 100px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
}

.champion-panel::before {
    content: '';
    position: absolute;
    inset: 0;
    /* Lighter vignette - much more visible */
    background:
        radial-gradient(ellipse at center, rgba(20, 24, 36, 0.3) 0%, rgba(20, 24, 36, 0.7) 100%),
        linear-gradient(to right, rgba(10, 14, 20, 0.5), rgba(10, 14, 20, 0.4));
    z-index: 0;
}

.champion-panel>* {
    position: relative;
    z-index: 1;
}

.cs2-map-panel::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at center, rgba(20, 24, 36, 0.3) 0%, rgba(20, 24, 36, 0.7) 100%),
        linear-gradient(to right, rgba(10, 14, 20, 0.5), rgba(10, 14, 20, 0.4));
    z-index: 0;
}

.cs2-map-panel {
    background-size: cover;
    background-position: center center;
}

.cs2-map-logo-inline {
    width: 20px;
    height: 20px;
    border-radius: 3px;
    object-fit: contain;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.55));
    flex-shrink: 0;
}

.champion-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.champion-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.role-icon-large {
    width: 20px;
    height: 20px;
    object-fit: contain;
    filter: brightness(0.95) drop-shadow(0 1px 2px rgba(0, 0, 0, 0.8));
    flex-shrink: 0;
}

.champion-name {
    font-size: 20px;
    font-weight: 600;
    color: #ffffff;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.9);
    line-height: 1;
}

.game-mode {
    font-size: 13px;
    color: #d1d5db;
    font-weight: 600;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
}

/* Stats Panel */
.stats-panel {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px 14px;
    background: rgba(30, 34, 46, 0.6);
    border-radius: 8px;
    min-width: 180px;
}

.stat-row {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 10px;
}

.stat-icon {
    font-size: 14px;
    opacity: 0.7;
}

.stat-label {
    font-size: 10px;
    font-weight: 450;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--text-muted);
}

.stat-value-right {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-primary);
    text-align: right;
}

.cs2-score-own {
    font-weight: 700;
}

.cs2-score-own.win {
    color: #10b981;
}

.cs2-score-own.loss {
    color: #ef4444;
}

.cs2-score-own.remake {
    color: var(--text-primary);
}

.cs2-score-own.draw {
    color: var(--text-primary);
    font-weight: 400;
}

.cs2-score-opponent {
    color: var(--text-primary);
}

.cs2-score-opponent.draw {
    color: var(--text-primary);
    font-weight: 400;
}

/* Live Match Cards */
.live-match-card {
    cursor: default;
}

.live-match-card:hover {
    transform: none;
    border-color: var(--border-color);
    box-shadow: none;
}

.live-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(239, 68, 68, 0.18);
    color: #f87171;
    border: 1px solid rgba(248, 113, 113, 0.45);
}

.live-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #ef4444;
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.75);
    animation: livePulse 1.2s ease-in-out infinite;
}

@keyframes livePulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.75);
    }

    70% {
        transform: scale(1.05);
        box-shadow: 0 0 0 7px rgba(239, 68, 68, 0);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }
}

.live-champion-panel {
    background-image: linear-gradient(135deg, rgba(16, 24, 44, 0.95) 0%, rgba(20, 52, 92, 0.82) 100%);
}

.live-stats-panel {
    justify-content: center;
}

.live-timer-value {
    min-width: 56px;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* Feed highlight miniplayer */
.match-highlight-mini {
    margin: 0 16px 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    background: rgba(14, 19, 31, 0.9);
}

.match-highlight-mini .match-highlight-title {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    padding: 8px 10px 6px;
}

.match-highlight-frame-wrap {
    width: 100%;
    min-height: 165px;
    background: rgba(10, 14, 24, 0.9);
}

.match-highlight-iframe {
    width: 100%;
    height: 100%;
    min-height: 165px;
    border: 0;
    display: block;
}

.match-highlight-mini-pending {
    padding-bottom: 10px;
}

.match-highlight-mini .match-highlight-pending-text {
    font-size: 12px;
    color: var(--text-secondary);
    padding: 0 10px 2px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .match-card {
        width: 100%;
        max-width: 550px;
    }

    .leetify-content {
        grid-template-columns: 1fr;
    }

    .stats-panel {
        flex-direction: row;
        flex-wrap: wrap;
        min-width: unset;
    }

    .stat-row {
        flex: 1;
        min-width: calc(50% - 6px);
    }
}
