/**
 * 명예의 전당 스타일
 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    min-height: 100vh;
    color: #fff;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* 헤더 */
.header {
    text-align: center;
    margin-bottom: 30px;
    position: relative;
}

.header h1 {
    font-size: 2.5rem;
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 30px rgba(255, 215, 0, 0.3);
}

.back-btn {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    color: #aaa;
    text-decoration: none;
    font-size: 1rem;
    transition: color 0.3s;
}

.back-btn:hover {
    color: #ffd700;
}

/* 헤더 상단 레이아웃 */
.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    position: relative;
}

/* 코인 표시 */
.coin-display {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 15px;
    background: rgba(255, 215, 0, 0.1);
    border: 2px solid #ffd700;
    border-radius: 20px;
    color: #ffd700;
    font-weight: bold;
    font-size: 1rem;
    cursor: help;
    transition: all 0.3s;
}

.coin-display:hover {
    background: rgba(255, 215, 0, 0.2);
    transform: scale(1.05);
}

.coin-icon {
    font-size: 1.2rem;
}

.coin-amount {
    min-width: 40px;
    text-align: right;
}

/* 탭 네비게이션 */
.tab-navigation {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 25px;
}

.tab-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 15px 30px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.05);
    color: #aaa;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 150px;
}

.tab-btn:hover {
    border-color: rgba(255, 215, 0, 0.5);
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.tab-btn.active {
    border-color: #ffd700;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.2), rgba(255, 215, 0, 0.1));
    color: #fff;
}

.tab-btn .tab-icon {
    font-size: 1.8rem;
}

.tab-btn .tab-title {
    font-size: 0.95rem;
    font-weight: bold;
}

.tab-btn.active .tab-title {
    color: #ffd700;
}

/* 게임 선택 */
.game-selector {
    text-align: center;
    margin-bottom: 30px;
}

.game-selector label {
    margin-right: 10px;
    font-size: 1.1rem;
}

.game-selector select {
    padding: 10px 20px;
    font-size: 1rem;
    border: 2px solid #ffd700;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    cursor: pointer;
    min-width: 200px;
}

.game-selector select option {
    background: #1a1a2e;
    color: #fff;
}

/* 리더보드 컨테이너 */
#leaderboards-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

/* 리더보드 카드 */
.leaderboard-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 20px;
    border: 1px solid rgba(255, 215, 0, 0.2);
    transition: transform 0.3s, box-shadow 0.3s;
}

.leaderboard-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(255, 215, 0, 0.2);
}

.game-title {
    font-size: 1.3rem;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 215, 0, 0.3);
    color: #ffd700;
}

/* 정렬 버튼 */
.sort-buttons {
    display: flex;
    gap: 8px;
    margin-bottom: 15px;
}

.sort-btn {
    padding: 6px 12px;
    font-size: 0.85rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    background: transparent;
    color: #aaa;
    cursor: pointer;
    transition: all 0.3s;
}

.sort-btn:hover {
    border-color: #ffd700;
    color: #ffd700;
}

.sort-btn.active {
    background: #ffd700;
    border-color: #ffd700;
    color: #1a1a2e;
    font-weight: bold;
}

/* 테이블 */
.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
}

.leaderboard-table th,
.leaderboard-table td {
    padding: 10px 8px;
    text-align: center;
}

.leaderboard-table th {
    color: #aaa;
    font-size: 0.85rem;
    font-weight: normal;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.leaderboard-table td {
    font-size: 0.95rem;
}

.leaderboard-table tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.leaderboard-table tr:last-child {
    border-bottom: none;
}

/* 상위 랭크 스타일 */
.top-rank {
    font-weight: bold;
}

.rank-1 {
    background: rgba(255, 215, 0, 0.15);
}

.rank-2 {
    background: rgba(192, 192, 192, 0.1);
}

.rank-3 {
    background: rgba(205, 127, 50, 0.1);
}

.rank {
    font-size: 1.2rem;
}

.nickname {
    text-align: left !important;
    padding-left: 15px !important;
    color: #fff;
}

.stat {
    color: #ddd;
}

/* 코인 부자 순위 섹션 */
.coin-ranking-section {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid rgba(255, 215, 0, 0.3);
}

.coin-ranking-section h2 {
    font-size: 1.3rem;
    margin-bottom: 15px;
    color: #ffd700;
}

.coin-ranking-table {
    width: 100%;
}

/* 1등 갱신 로그 섹션 */
.champion-log-section {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 20px;
    border: 1px solid rgba(255, 215, 0, 0.2);
}

.champion-log-section h2 {
    font-size: 1.3rem;
    margin-bottom: 15px;
    color: #ffd700;
}

.log-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    margin-bottom: 8px;
}

.log-item:last-child {
    margin-bottom: 0;
}

.log-emoji {
    font-size: 1.3rem;
}

.log-message {
    flex: 1;
    font-size: 0.95rem;
}

.log-message strong {
    color: #ffd700;
}

.game-badge {
    background: rgba(255, 215, 0, 0.2);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.85rem;
}

.log-date {
    color: #888;
    font-size: 0.85rem;
}

/* 상태 메시지 */
.loading,
.error,
.empty-state,
.no-logs {
    text-align: center;
    padding: 40px;
    color: #888;
}

.empty-state p {
    margin: 10px 0;
}

.error {
    color: #ff6b6b;
}

/* 반응형 */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }

    .header h1 {
        font-size: 1.8rem;
    }

    .back-btn {
        position: static;
        display: block;
        margin-bottom: 15px;
        transform: none;
    }

    .tab-navigation {
        gap: 10px;
    }

    .tab-btn {
        padding: 12px 20px;
        min-width: 130px;
    }

    .tab-btn .tab-icon {
        font-size: 1.5rem;
    }

    .tab-btn .tab-title {
        font-size: 0.85rem;
    }

    #leaderboards-container {
        grid-template-columns: 1fr;
    }

    .leaderboard-table th,
    .leaderboard-table td {
        padding: 8px 5px;
        font-size: 0.85rem;
    }

    .sort-buttons {
        flex-wrap: wrap;
        justify-content: center;
    }

    .log-item {
        flex-wrap: wrap;
    }

    .log-date {
        width: 100%;
        text-align: right;
        margin-top: 5px;
    }
}
