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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #0a0a0a;
    color: #ffffff;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    padding: 30px 0;
    border-bottom: 1px solid #222;
}

header .banner {
    max-width: 100%;
    height: auto;
    max-height: 120px;
}

header h1 {
    font-size: 32px;
    font-weight: 600;
}

.search-bar {
    margin: 30px 0;
    position: relative;
}

.search-bar i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
}

#search-input {
    width: 100%;
    padding: 12px 12px 12px 45px;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 8px;
    color: #fff;
    font-size: 16px;
}

#search-input:focus {
    outline: none;
    border-color: #555;
}

.mode-tabs {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 20px 0;
    overflow-x: auto;
    padding: 15px 10px;
    background: #0f0f0f;
    border-radius: 12px;
    border: 1px solid #222;
}

.mode-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 12px 18px;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 10px;
    color: #888;
    cursor: pointer;
    white-space: nowrap;
    font-size: 13px;
    transition: all 0.2s;
    min-width: 80px;
}

.mode-tab .mode-icon {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.mode-tab i {
    font-size: 24px;
}

.mode-tab:hover {
    background: #222;
    border-color: #444;
    color: #fff;
}

.mode-tab.active {
    background: #2a1a1a;
    border-color: #ff4444;
    color: #ff4444;
}

.leaderboard {
    background: #1a1a1a;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #333;
}

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

thead {
    background: #0f0f0f;
    border-bottom: 1px solid #333;
}

th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    color: #888;
    font-size: 12px;
    text-transform: uppercase;
}

th:first-child {
    width: 60px;
}

tbody tr {
    border-bottom: 1px solid #222;
    cursor: pointer;
}

tbody tr:hover {
    background: #222;
}

tbody tr.rank-1 {
    background: rgba(255, 215, 0, 0.1);
    border-left: 3px solid #FFD700;
}

tbody tr.rank-2 {
    background: rgba(192, 192, 192, 0.1);
    border-left: 3px solid #C0C0C0;
}

tbody tr.rank-3 {
    background: rgba(205, 127, 50, 0.1);
    border-left: 3px solid #CD7F32;
}

tbody tr.rank-ht {
    background: rgba(255, 68, 68, 0.1);
    border-left: 3px solid #ff4444;
}

tbody tr.rank-1:hover {
    background: rgba(255, 215, 0, 0.15);
}

tbody tr.rank-2:hover {
    background: rgba(192, 192, 192, 0.15);
}

tbody tr.rank-3:hover {
    background: rgba(205, 127, 50, 0.15);
}

tbody tr.rank-ht:hover {
    background: rgba(255, 68, 68, 0.15);
}

tbody tr.blacklisted {
    opacity: 0.5;
    background: rgba(40, 40, 40, 0.5);
}

tbody tr.blacklisted:hover {
    opacity: 0.6;
    background: rgba(50, 50, 50, 0.5);
}

.bl-badge {
    display: inline-block;
    padding: 2px 6px;
    background: #ff4444;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    border-radius: 3px;
    margin-right: 6px;
    vertical-align: middle;
}

td {
    padding: 15px;
}

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

.player-avatar {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    background: #333;
}

.tier-badges {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.tier-icons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.tier-icon-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.mode-icon-small {
    width: 32px;
    height: 32px;
    object-fit: contain;
    border-radius: 6px;
    background: #0f0f0f;
    padding: 4px;
    border: 1px solid #333;
}

.tier-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    border: 1px solid;
}

.tier-badge.ht1 { background: #3d1616; border-color: #ff4444; color: #ff4444; }
.tier-badge.lt1 { background: #1a2633; border-color: #5599ff; color: #5599ff; }
.tier-badge.ht2 { background: #3d1616; border-color: #ff4444; color: #ff4444; }
.tier-badge.lt2 { background: #1a2633; border-color: #5599ff; color: #5599ff; }
.tier-badge.ht3 { background: #3d1616; border-color: #ff4444; color: #ff4444; }
.tier-badge.lt3 { background: #1a2633; border-color: #5599ff; color: #5599ff; }
.tier-badge.ht4 { background: #3d1616; border-color: #ff4444; color: #ff4444; }
.tier-badge.lt4 { background: #1a2633; border-color: #5599ff; color: #5599ff; }
.tier-badge.ht5 { background: #3d1616; border-color: #ff4444; color: #ff4444; }
.tier-badge.lt5 { background: #1a2633; border-color: #5599ff; color: #5599ff; }

.loading {
    text-align: center;
    color: #666;
    padding: 40px !important;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: #1a1a1a;
    border-radius: 12px;
    border: 1px solid #333;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    padding: 30px;
}

.blacklisted-modal {
    background: #1a1a1a;
    border: 2px solid #ff4444 !important;
}

.blacklist-stamp {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-5deg);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    pointer-events: none;
    z-index: 10;
}

.blacklist-stamp i {
    font-size: 120px;
    color: #ff4444;
    opacity: 0.3;
}

.blacklist-stamp span {
    font-size: 48px;
    font-weight: 900;
    color: #ff4444;
    text-transform: uppercase;
    letter-spacing: 8px;
    opacity: 0.8;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #2a2a2a;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    font-size: 18px;
}

.modal-close:hover {
    background: #333;
}

.modal-header {
    text-align: center;
    margin-bottom: 20px;
    margin-top: 30px;
    position: relative;
}

.modal-header::before {
    content: '';
    position: absolute;
    top: -50px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 60px;
    background: url('assets/lctiers_logo.png') center/contain no-repeat;
    opacity: 0.3;
    pointer-events: none;
    user-select: none;
}

#modal-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 3px solid #ff4444;
    margin-bottom: 15px;
}

#modal-username {
    font-size: 28px;
    margin-bottom: 5px;
}

.discord-id {
    color: #666;
    font-size: 14px;
}

.profile-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 12px;
    background: #2a2a2a;
    border: 1px solid #444;
    border-radius: 8px;
    color: #fff;
    text-decoration: none;
    margin: 20px 0;
    font-weight: 500;
}

.profile-button:hover {
    background: #333;
}

.modal-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin: 20px 0;
}

.stat-box {
    background: #0f0f0f;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
}

.stat-label {
    color: #666;
    font-size: 12px;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 32px;
    font-weight: 600;
    color: #ff4444;
}

.modal-tiers {
    margin-top: 30px;
}

.modal-tiers h3 {
    font-size: 14px;
    text-transform: uppercase;
    color: #666;
    margin-bottom: 15px;
}

#modal-tiers-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tier-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 15px;
    background: #0f0f0f;
    border: 1px solid #333;
    border-radius: 8px;
}

.tier-item-icon {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.tier-item i {
    font-size: 18px;
}

.tier-item-info {
    display: flex;
    flex-direction: column;
}

.tier-item-mode {
    font-size: 11px;
    color: #666;
    text-transform: uppercase;
}

.tier-item-tier {
    font-size: 14px;
    font-weight: 600;
}

@media (max-width: 768px) {
    .mode-tabs {
        flex-wrap: nowrap;
    }
    
    table {
        font-size: 14px;
    }
    
    .tier-icons {
        display: none;
    }
}
