:root {
    --bg-color: #0b0e14;
    --card-bg: #161b22;
    --nav-bg: #161b22;
    --text-primary: #f0f6fc;
    --text-secondary: #8b949e;
    --accent-blue: #58a6ff;
    --border-color: #30363d;
    
    --t1-color: #f1c40f;
    --t2-color: #bdc3c7;
    --t3-color: #e67e22;
    --t4-color: #3498db;
    --t5-color: #95a5a6;
    
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: 'Outfit', sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
}

/* ─── Navbar ────────────────────────────────────────────────────────────────── */

.navbar {
    background: var(--nav-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 0.8rem 2rem;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 2rem;
}

.logo-text {
    font-weight: 800;
    font-size: 1.4rem;
    letter-spacing: 1px;
    background: linear-gradient(90deg, #fff 0%, #aaa 50%, #fff 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shimmer 5s infinite linear;
}

@keyframes shimmer {
    0% { background-position: 0% center; }
    100% { background-position: 200% center; }
}

.nav-links {
    display: flex;
    gap: 1.5rem;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-links a.active, .nav-links a:hover {
    color: var(--text-primary);
    text-shadow: 0 0 10px rgba(255,255,255,0.2);
}

.search-box {
    margin-left: auto;
    background: #0d1117;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.5rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    width: 300px;
    transition: var(--transition);
}

.search-box:focus-within {
    border-color: var(--accent-blue);
    box-shadow: 0 0 10px rgba(88, 166, 255, 0.2);
}

.search-box input {
    background: transparent;
    border: none;
    color: var(--text-primary);
    outline: none;
    width: 100%;
}

/* ─── Layout ─────────────────────────────────────────────────────────────────── */

.container {
    max-width: 1400px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.game-tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    background: rgba(22, 27, 34, 0.6);
    backdrop-filter: blur(8px);
    padding: 0.5rem;
    border-radius: 12px;
    width: fit-content;
    border: 1px solid var(--border-color);
}

.tab-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-family: inherit;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tab-btn:hover {
    color: var(--text-primary);
    background: rgba(255,255,255,0.05);
}

.tab-btn.active {
    background: linear-gradient(135deg, #232931 0%, #161b22 100%);
    color: var(--text-primary);
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.1);
}

/* ─── Leaderboard Grid ──────────────────────────────────────────────────────── */

.leaderboard-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1.2rem;
    align-items: start;
}

.tier-column {
    background: rgba(48, 54, 61, 0.15);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 16px;
    overflow: hidden;
    min-height: 400px;
    transition: var(--transition);
}

.tier-column:hover {
    background: rgba(48, 54, 61, 0.25);
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.tier-header {
    padding: 1.2rem;
    text-align: center;
    font-weight: 700;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    background: rgba(0,0,0,0.3);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.tier-header.t1 { background: rgba(241, 196, 15, 0.1); color: var(--t1-color); text-shadow: 0 0 10px rgba(241, 196, 15, 0.3); }
.tier-header.t2 { background: rgba(189, 195, 199, 0.08); color: var(--t2-color); text-shadow: 0 0 10px rgba(189, 195, 199, 0.3); }
.tier-header.t3 { background: rgba(230, 126, 34, 0.08); color: var(--t3-color); text-shadow: 0 0 10px rgba(230, 126, 34, 0.3); }
.tier-header.t4 { background: rgba(52, 152, 219, 0.08); color: var(--t4-color); }
.tier-header.t5 { background: rgba(149, 165, 166, 0.08); color: var(--t5-color); }

.player-list {
    padding: 0.8rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

/* ─── Player Row ────────────────────────────────────────────────────────────── */

.player-row {
    background: rgba(22, 27, 34, 0.8);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0.8rem 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: var(--transition);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.player-row:hover {
    transform: scale(1.02);
    border-color: #555;
    background: #1c2128;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.player-skin {
    width: 36px;
    height: 36px;
    border-radius: 6px;
    background: #07090d;
    object-fit: contain;
    transition: var(--transition);
}

.player-row:hover .player-skin {
    transform: rotate(5deg) scale(1.1);
}

.player-name {
    font-weight: 600;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.row-arrow {
    margin-left: auto;
    color: var(--text-secondary);
    font-size: 0.7rem;
    opacity: 0.4;
}

/* HT/LT indicator glow */
.player-row[data-subtier^="ht"]::after {
    content: '';
    position: absolute;
    right: -2px;
    top: 20%;
    bottom: 20%;
    width: 3px;
    background: var(--accent-blue);
    border-radius: 3px 0 0 3px;
    box-shadow: -2px 0 10px rgba(88, 166, 255, 0.4);
}

/* ─── Toast Notifications ─── */
#toast-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 2000;
}

.toast {
    background: rgba(22, 27, 34, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--accent-blue);
    color: #fff;
    padding: 14px 28px;
    border-radius: 10px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.6);
    animation: toastIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    cursor: pointer;
    font-weight: 500;
    min-width: 250px;
}

@keyframes toastIn {
    from { transform: translateX(120%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ─── Modal ─── */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
    z-index: 3000;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: #161b22;
    width: 450px;
    border-radius: 24px;
    border: 1px solid var(--border-color);
    position: relative;
    padding: 3rem 2rem;
    box-shadow: 0 25px 50px rgba(0,0,0,0.8);
    animation: slideUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

.close-btn {
    position: absolute;
    top: 20px;
    right: 25px;
    font-size: 2rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.close-btn:hover {
    color: #fff;
    transform: rotate(90deg);
}

.modal-header-main {
    text-align: center;
    margin-bottom: 2.5rem;
}

.modal-avatar-container {
    width: 120px;
    height: 120px;
    background: #0d1117;
    border-radius: 50%;
    margin: 0 auto 1.5rem;
    padding: 10px;
    border: 2px solid var(--border-color);
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
    overflow: hidden;
}

.modal-avatar-container img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transform: scale(1.4);
}

#modalName {
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.modal-tag {
    background: rgba(88, 166, 255, 0.1);
    color: var(--accent-blue);
    padding: 6px 20px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    display: inline-block;
    margin-bottom: 0.8rem;
}

.modal-region {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.modal-stats {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.stat-label {
    display: block;
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 700;
    margin-bottom: 0.8rem;
    letter-spacing: 1px;
}

.stat-value {
    background: rgba(0,0,0,0.2);
    padding: 1rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    font-size: 1.2rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-value i {
    color: #f1c40f;
}

.tiers-grid {
    display: flex;
    gap: 0.8rem;
    background: rgba(0,0,0,0.2);
    padding: 1rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.mini-tier {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    flex: 1;
}

.mini-tier i { font-size: 1.1rem; color: var(--text-secondary); }
.mini-tier span { font-size: 0.8rem; font-weight: 700; }
.mini-tier.t-active i { color: #f1c40f; }

.namemc-btn {
    display: block;
    margin-top: 2.5rem;
    text-align: center;
    background: #30363d;
    color: #fff;
    text-decoration: none;
    padding: 12px;
    border-radius: 12px;
    font-weight: 600;
    transition: var(--transition);
    border: 1px solid transparent;
}

.namemc-btn:hover {
    background: #3c444d;
    border-color: #555;
    transform: translateY(-2px);
}

.opacity-50 { opacity: 0.5; }

/* Responsive */
@media (max-width: 500px) {
    .modal-content { width: 90%; padding: 2rem 1rem; }
    #modalName { font-size: 1.8rem; }
}
