:root {
    --bg-color: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.7);
    --accent-color: #38bdf8;
    --accent-gold: #f59e0b;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --nav-bg: rgba(15, 23, 42, 0.95);
    --glass-border: rgba(255, 255, 255, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    overflow-x: hidden;
    min-height: 100vh;
}

#app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding-bottom: 80px;
}

header {
    padding: 20px;
    text-align: center;
    background: linear-gradient(to bottom, #1e293b, transparent);
}

h1 {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.025em;
}

main {
    flex: 1;
    padding: 10px 20px;
}

/* Loader */
.loader-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 60vh;
}

.loader {
    width: 48px;
    height: 48px;
    border: 5px solid #FFF;
    border-bottom-color: var(--accent-color);
    border-radius: 50%;
    display: inline-block;
    box-sizing: border-box;
    animation: rotation 1s linear infinite;
}

@keyframes rotation {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.hidden {
    display: none !important;
}

/* Leaderboard List */
.leaderboard-item {
    display: flex;
    align-items: center;
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 12px 16px;
    margin-bottom: 12px;
    animation: slideIn 0.3s ease-out forwards;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.rank {
    font-weight: 700;
    width: 30px;
    color: var(--text-secondary);
}

.rank.top-1 {
    color: var(--accent-gold);
}

.rank.top-2 {
    color: #cbd5e1;
}

.rank.top-3 {
    color: #b45309;
}

.user-info {
    flex: 1;
    margin-left: 10px;
}

.user-name {
    font-weight: 600;
    display: block;
}

.user-score {
    font-size: 0.85rem;
    color: var(--accent-color);
    font-weight: 500;
}

.user-streak {
    font-size: 0.75rem;
    background: rgba(245, 158, 11, 0.2);
    color: var(--accent-gold);
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: 10px;
}

/* Profile Card */
.profile-card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 30px 20px;
    text-align: center;
    margin-top: 20px;
}

.user-avatar {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--accent-color), #4f46e5);
    background-size: cover;
    background-position: center;
    border-radius: 50%;
    margin: 0 auto 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2rem;
    font-weight: 700;
    color: white;
    box-shadow: 0 10px 25px -5px rgba(56, 189, 248, 0.4);
    border: 2px solid var(--glass-border);
}

.user-avatar-mini {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--accent-color), #4f46e5);
    background-size: cover;
    background-position: center;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.9rem;
    font-weight: 600;
    color: white;
    margin-right: 12px;
    border: 1px solid var(--glass-border);
    flex-shrink: 0;
}

.user-avatar-mini[style*="background-image"] {
    color: transparent !important;
}

.user-avatar {
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, var(--accent-color), #4f46e5);
    background-size: cover;
    background-position: center;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2rem;
    font-weight: bold;
    color: white;
    margin-bottom: 15px;
    border: 3px solid var(--glass-border);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

.user-avatar[style*="background-image"] {
    color: transparent !important;
}

#profile-name {
    margin-bottom: 25px;
}

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

.stat-item {
    background: rgba(255, 255, 255, 0.05);
    padding: 15px;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 5px;
}

.stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* Bottom Nav */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 70px;
    background: var(--nav-bg);
    backdrop-filter: blur(20px);
    border-top: 1px solid var(--glass-border);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding-bottom: env(safe-area-inset-bottom);
    z-index: 100;
}

.nav-item {
    background: none;
    border: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--text-secondary);
    transition: all 0.2s;
    width: 33.33%;
}

.nav-item.active {
    color: var(--accent-color);
}

.nav-icon {
    font-size: 1.25rem;
    margin-bottom: 4px;
}

.nav-label {
    font-size: 0.7rem;
    font-weight: 500;
}