/* ============================================
   ZikLol - 정보 중심 전적 서비스 UI
   가이드라인: 절제된 UI, 흑백 기반, 좌/우 정렬 중심
   ============================================ */

:root {
    /* 컬러 시스템 - 세련된 색상 팔레트 */
    --text-primary: #1A1A1A;
    --text-secondary: #4A5568;
    --text-muted: #718096;
    
    --border: #E2E8F0;
    --divider: #E2E8F0;
    
    --bg-primary: #FFFFFF;
    --bg-surface: #F7FAFC;
    --bg-hover: #EDF2F7;
    --bg-header: #1A202C;
    --bg-hero: #F7FAFC;
    
    /* 주요 액센트 색상 - 전역 변수 사용 */
    --accent-primary: var(--color-accent, #1E293B);
    --accent-primary-hover: var(--color-accent-hover, #0F172A);
    --accent-secondary: var(--color-success, #16A34A);
    
    /* 탭/네비게이션 */
    --nav-active: var(--team-blue, #4299E1);
    --nav-active-bg: #EBF8FF;
    --nav-hover: #2D3748;
    
    /* 팀 구분용 - 전역 변수 사용 */
    --team-blue: var(--team-blue, #4299E1);
    --team-red: var(--team-red, #F56565);
    
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
}

* {
    box-sizing: border-box;
}

body {
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: "Noto Sans KR", sans-serif;
    line-height: 1.5;
    margin: 0;
    padding: 0;
}

/* ============================================
   Hero Section - 다크 네이비 + 블루 포인트
   ============================================ */
.hero-section {
    background: linear-gradient(135deg, #0B1220 0%, #0F1B33 50%, #0B1220 100%);
    border-bottom: none;
    padding: 2.5rem 0 2rem 0;
}

.hero-content {
    display:flex;
    flex-direction: column;
    gap: var(--spacing-lg);
    max-width: 1200px;
    margin: 0 auto;
    text-align: left;
}

.hero-content-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.hero-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #EAF0FF;
    margin: 0 0 1.5rem 0;
    line-height: 1.4;
}

/* 통계 카드 - 컴팩트 */
.hero-stats-cards {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.hero-stat-card {
    background: rgba(255, 255, 255, 0.10);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-top: 2px solid #3B82F6;
    border-radius: 6px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-width: 160px;
    flex: 0 1 auto;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    position: relative;
}

.hero-stat-card:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.20);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.hero-stat-label {
    font-size: 0.75rem;
    color: #A9B4CC;
    margin-bottom: 4px;
    font-weight: 500;
    line-height: 1.2;
}

.hero-stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: #EAF0FF;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

/* ============================================
   Hero Search
   ============================================ */
.hero-search-wrapper {
    position: relative;
    max-width: 500px;
    width: 100%;
}

.hero-search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(234, 240, 255, 0.6);
    font-size: 0.9375rem;
    z-index: 2;
}

.hero-search-input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.75rem;
    font-size: 0.9375rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    color: #EAF0FF;
    transition: all 0.2s;
    font-weight: 400;
}

.hero-search-input::placeholder {
    color: rgba(234, 240, 255, 0.7);
}

.hero-search-input:focus {
    outline: none;
    border-color: #3B82F6;
    background: rgba(255, 255, 255, 0.18);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.hero-search-results {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 6px;
    z-index: 1000;
    max-height: 400px;
    overflow-y: auto;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.hero-search-results .search-result-item {
    display: block;
    padding: 0.875rem 1.25rem;
    border-bottom: 1px solid #E2E8F0;
    text-decoration: none;
    color: inherit;
    transition: background-color 0.2s;
}

.hero-search-results .search-result-item:last-child {
    border-bottom: none;
}

.hero-search-results .search-result-item:hover {
    background: #F7FAFC;
    text-decoration: none;
    color: inherit;
}

.hero-search-results .search-result-name {
    font-weight: 600;
    color: #1A202C;
    font-size: 0.9375rem;
}

.hero-search-results .search-result-meta {
    font-size: 0.875rem;
    color: #4A5568;
    margin-top: 0.25rem;
}

.hero-search-results .search-result-empty {
    padding: 1rem;
    text-align: center;
    color: #718096;
    font-size: 0.875rem;
}

/* ============================================
   Main Layout - 레퍼런스 스타일: 자연스러운 흐름
   ============================================ */
.main-wrapper {
    position: relative;
    padding: var(--spacing-xl) 0;
    /* background: var(--bg-primary); */
    min-height: 100vh;
    pointer-events: none;
}

.main-wrapper > * {
    pointer-events: auto;
}

.main-content-wrapper {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}
/* ============================================
   Banner Section - Dark Background Style
   ============================================ */
.banner-section {
    position: relative;
    display: flex;
    flex-direction: column;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

/* 후원자 배너: 다크 그린 틴트 */
.banner-sponsor {
    background: linear-gradient(135deg, rgba(45, 80, 22, 0.95) 0%, rgba(85, 107, 47, 0.9) 100%);
}

/* 우승자 배너: 다크 차콜/브론즈 틴트 */
.banner-winner {
    background: linear-gradient(135deg, rgba(54, 69, 79, 0.95) 0%, rgba(139, 115, 85, 0.9) 100%);
}

/* 헤더: 아이콘 + 타이틀 */
.banner-section-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    justify-content: center;
    text-align: center;
}

.banner-section-header-large {
    padding-top: var(--spacing-lg);
    padding-bottom: var(--spacing-lg);
}

.banner-icon {
    width: 20px;
    height: 20px;
    color: rgba(255, 255, 255, 0.9);
    flex-shrink: 0;
}

.banner-section-title {
    font-family: "Noto Sans KR", sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.95);
    letter-spacing: 0.3px;
}

/* 워터마크 SVG - 우상단 */
.banner-watermark {
    position: absolute;
    top: 0;
    right: 0;
    width: 120px;
    height: 120px;
    opacity: 0.08;
    pointer-events: none;
    overflow: hidden;
}

.banner-watermark svg {
    width: 100%;
    height: 100%;
    color: rgba(255, 255, 255, 0.3);
}

/* 본문 영역 */
.banner-content {
    position: relative;
    padding: var(--spacing-xs) 0;
    z-index: 1;
    text-align: center;
}

/* ============================================
   후원자 배너: 한 줄 레이아웃 (닉네임 | 금액)
   ============================================ */
.banner-sponsor .banner-content {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.banner-sponsor .banner-row {
    display: grid;
    grid-template-columns: 70% 30%;
    align-items: center;
    justify-items: center;
    gap: 0.25rem;
    padding: var(--spacing-sm) var(--spacing-sm);
    min-height: 64px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: background-color 0.2s ease;
    text-decoration: none;
    color: inherit;
}

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

.banner-sponsor .banner-row:hover {
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    /* padding-left: 0.5rem;
    padding-right: 0.5rem; */
}

.banner-sponsor .banner-player-name {
    font-size: 1rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.5;
    transition: color 0.2s ease;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0 0.5rem;
    min-width: 0;
    max-width: 100%;
    justify-self: center;
}

.banner-sponsor .banner-row:hover .banner-player-name {
    color: rgba(255, 255, 255, 1);
}

.banner-sponsor .banner-player-amount {
    font-size: 1rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.95);
    font-variant-numeric: tabular-nums;
    text-align: center;
    justify-self: center;
    min-width: 80px;
    padding: 0.25rem 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    white-space: nowrap;
}

/* ============================================
   우승자 배너: 좌측 Identity | 우측 Score
   ============================================ */
.banner-winner .banner-content {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.banner-winner-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-sm);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    text-decoration: none;
    color: inherit;
    transition: background-color 0.2s ease;
    min-height: 64px;
    min-width: 0;
}

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

.banner-winner-row:hover {
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    /* padding-left: var(--spacing-sm);
    padding-right: var(--spacing-sm); */
}

/* Identity 영역: 닉네임 + 포지션 */
.banner-identity {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    flex-wrap: nowrap;
    justify-content: center;
    text-align: center;
    min-width: 0;
    max-width: 70%;
}

.banner-winner .banner-player-name {
    font-size: 1rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.95);
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    max-width: 100%;
}

.banner-winner .banner-player-role {
    font-size: 1rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.7);
    padding: 0.125rem 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    white-space: nowrap;
}

/* Score 영역: 큰 숫자 + 작은 '점' */
.banner-score-area {
    display: flex;
    align-items: baseline;
    gap: 0.125rem;
    justify-content: center;
    text-align: center;
    white-space: nowrap;
}

.banner-winner .banner-player-score {
    font-size: 1rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.95);
    font-variant-numeric: tabular-nums;
    line-height: 1;
    white-space: nowrap;
}

.banner-score-unit {
    font-size: 1rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.6);
    margin-left: 0.125rem;
    white-space: nowrap;
}

.banner-image {
    width: 100%;
    height: auto;
    display: block;
}

.banner-link {
    display: block;
    text-decoration: none;
}

.banner-text-card {
    padding: var(--spacing-md);
    min-height: 150px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.banner-text-title {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 0.5rem 0;
    color: var(--text-primary);
}

.banner-text-description {
    font-size: 0.875rem;
    margin: 0;
    line-height: 1.5;
    color: var(--text-secondary);
}

/* ============================================
   Leaderboard Section - Gaming Style
   ============================================ */
.leaderboard-section {
    margin-bottom: var(--spacing-xl);
}

.leaderboard-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-md);
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: var(--spacing-lg);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.leaderboard-toggle-wrapper {
    grid-column: 1 / -1;
    margin-top: var(--spacing-md);
}

.btn-week-leaderboard {
    width: 100%;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    background: var(--color-accent, #1E293B);
    border: 1px solid var(--color-accent, #1E293B);
    border-radius: 6px;
    color: white;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-week-leaderboard:hover {
    background: var(--color-accent-hover, #0F172A);
    border-color: var(--color-accent-hover, #0F172A);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(30, 41, 59, 0.2);
}

.leaderboard-column {
    display: flex;
    flex-direction: column;
}

.leaderboard-header {
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-sm);
    border-bottom: 2px solid var(--divider);
}

.leaderboard-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    text-align: center;
}

.leaderboard-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.leaderboard-item,
a.leaderboard-item {
    display: grid;
    grid-template-columns: 30px 1fr auto auto auto;
    gap: var(--spacing-sm);
    align-items: center;
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    transition: all 0.2s;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.leaderboard-item.positive {
    background: rgba(22, 163, 74, 0.08);
}

.leaderboard-item.negative {
    background: rgba(217, 119, 6, 0.08);
}

.leaderboard-item.leaderboard-top {
    border-color: var(--accent-primary);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.leaderboard-item.leaderboard-top.positive {
    background: rgba(22, 163, 74, 0.12);
}

.leaderboard-item.leaderboard-top.negative {
    background: rgba(217, 119, 6, 0.12);
}

.leaderboard-expanded {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-sm);
}

.leaderboard-item:hover,
a.leaderboard-item:hover {
    border-color: var(--text-secondary);
    transform: translateX(2px);
}

.leaderboard-item.positive:hover {
    background: rgba(22, 163, 74, 0.12);
}

.leaderboard-item.negative:hover {
    background: rgba(217, 119, 6, 0.12);
}

.leaderboard-rank {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-align: center;
}

.leaderboard-name {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.leaderboard-role {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-align: center;
    padding: 2px 6px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 4px;
}

.leaderboard-score {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

.leaderboard-diff {
    font-size: 0.875rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.leaderboard-diff.positive {
    color: var(--color-success, #16A34A);
}

.leaderboard-diff.negative {
    color: var(--color-danger, #D97706);
}

.leaderboard-empty {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.875rem;
    padding: var(--spacing-md);
    grid-column: 1 / -1;
}

/* ============================================
   Main Content Area
   ============================================ */
.main-content-area {
    min-width: 0;
    width: 100%;
    max-width: 1080px;
}

.section-header {
    margin-bottom: var(--spacing-md);
}

.section-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 var(--spacing-sm) 0;
}

.section-divider {
    height: 1px;
    background: var(--divider);
    margin-top: var(--spacing-sm);
}

.games-container {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

/* ============================================
   Load More
   ============================================ */
.load-more-wrapper {
    text-align: center;
    margin-top: var(--spacing-xl);
}

.btn-load-more {
    width: 100%;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    background: var(--color-accent, #1E293B);
    border: 1px solid var(--color-accent, #1E293B);
    border-radius: 6px;
    color: white;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-load-more:hover {
    background: var(--color-accent-hover, #0F172A);
    border-color: var(--color-accent-hover, #0F172A);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(30, 41, 59, 0.2);
}

.btn-load-more:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 768px) {
    .hero-section {
        padding: 2rem 0 1.5rem 0;
    }
    
    .hero-content-top {
        flex-direction: column;
        gap: var(--spacing-md);
    }
    
    .hero-title {
        font-size: 1.375rem;
        margin-bottom: 0;
    }
    
    .hero-stats-cards {
        flex-direction: row;
        gap: 12px;
        width: 100%;
    }
    
    .hero-stat-card {
        min-width: auto;
        flex: 1;
        padding: 10px 12px;
    }
    
    .hero-stat-value {
        font-size: 1.5rem;
    }
    
    .hero-stat-label {
        font-size: 0.6875rem;
    }
    
    .hero-section {
        background: linear-gradient(180deg, #0B1220 0%, #0F1B33 100%);
    }
    
    .hero-search-wrapper {
        max-width: 100%;
    }
    
    .leaderboard-container {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
        padding: var(--spacing-md);
    }
    
    .leaderboard-item {
        grid-template-columns: 25px 1fr auto auto auto;
        gap: var(--spacing-xs);
        padding: var(--spacing-xs) var(--spacing-sm);
    }
    
    .leaderboard-name {
        font-size: 0.875rem;
    }
    
    .leaderboard-role {
        font-size: 0.75rem;
        padding: 1px 4px;
    }
    
    .leaderboard-score,
    .leaderboard-diff {
        font-size: 0.8125rem;
    }
    
    .btn-week-leaderboard {
        font-size: 0.875rem;
        padding: var(--spacing-xs) var(--spacing-md);
    }
}
