:root {
    --bg: #0f172a;
    --surface: #1e293b;
    --text: #f8fafc;
    --muted: #94a3b8;
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --danger: #ef4444;
    --success: #22c55e;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

/* Navbar */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255,255,255,0.1);
    position: sticky;
    top: 0;
}

.logo { font-size: 1.5rem; font-weight: 700; }
.nav-links a { color: var(--muted); text-decoration: none; margin-left: 2rem; transition: color 0.2s; }
.nav-links a:hover { color: var(--text); }
.btn-login { border: 1px solid var(--accent); padding: 0.5rem 1rem; border-radius: 6px; color: var(--accent) !important; }

/* Hero */
.hero {
    text-align: center;
    padding: 6rem 2rem 4rem;
    background: radial-gradient(ellipse at top, rgba(59,130,246,0.15), transparent);
}

.hero h1 { font-size: 3.5rem; margin-bottom: 1rem; background: linear-gradient(135deg, #fff, #60a5fa); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.hero p { font-size: 1.25rem; color: var(--muted); margin-bottom: 2rem; }

.cta-buttons { display: flex; gap: 1rem; justify-content: center; }
.btn-primary, .btn-secondary {
    padding: 0.875rem 2rem;
    border-radius: 8px;
    border: none;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-primary { background: var(--accent); color: white; }
.btn-primary:hover { background: var(--accent-hover); transform: translateY(-1px); }
.btn-secondary { background: transparent; border: 1px solid rgba(255,255,255,0.2); color: var(--text); }
.btn-secondary:hover { border-color: var(--accent); }

/* Features */
.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    padding: 4rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.feature-card {
    background: var(--surface);
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.05);
    transition: transform 0.2s;
}
.feature-card:hover { transform: translateY(-4px); border-color: rgba(59,130,246,0.3); }
.icon { font-size: 2rem; margin-bottom: 1rem; }
.feature-card h3 { margin-bottom: 0.5rem; }
.feature-card p { color: var(--muted); }

/* Leaderboard */
.leaderboard { padding: 2rem; max-width: 900px; margin: 0 auto; }
.leaderboard h2 { margin-bottom: 1.5rem; text-align: center; }
table { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: 12px; overflow: hidden; }
th, td { padding: 1rem; text-align: left; border-bottom: 1px solid rgba(255,255,255,0.05); }
th { background: rgba(59,130,246,0.1); font-weight: 600; }
.tag { color: var(--success); font-size: 0.875rem; }
.tag.pending { color: #f59e0b; }

/* Footer */
footer { text-align: center; padding: 3rem 2rem; color: var(--muted); border-top: 1px solid rgba(255,255,255,0.05); }
.small { font-size: 0.875rem; margin-top: 0.5rem; opacity: 0.7; }

/* Modal */
.modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}
.modal.hidden { display: none; }
.modal-content {
    background: var(--surface);
    padding: 2rem;
    border-radius: 12px;
    max-width: 400px;
    text-align: center;
    position: relative;
}
.close { position: absolute; top: 1rem; right: 1rem; cursor: pointer; font-size: 1.5rem; color: var(--muted); }
.hint { color: var(--muted); margin: 1rem 0; font-size: 0.9rem; }

/* Login page */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.login-container {
    background: var(--surface);
    padding: 2.5rem;
    border-radius: 16px;
    width: 100%;
    max-width: 400px;
    border: 1px solid rgba(255,255,255,0.05);
}
.login-container .logo { text-align: center; margin-bottom: 0.5rem; }
.login-container h2 { text-align: center; margin-bottom: 1.5rem; font-weight: 600; }

.input-group { margin-bottom: 1rem; }
.input-group label { display: block; margin-bottom: 0.5rem; font-size: 0.875rem; color: var(--muted); }
.input-group input {
    width: 100%;
    padding: 0.75rem;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.1);
    background: var(--bg);
    color: var(--text);
    font-size: 1rem;
}
.input-group input:focus { outline: none; border-color: var(--accent); }

.full { width: 100%; margin-top: 0.5rem; }

.no-account { margin-top: 1.5rem; text-align: center; }
.no-account > p { color: var(--muted); margin-bottom: 1rem; }

.admin-notice {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
}
.admin-notice .lock { font-size: 1.5rem; display: block; margin-bottom: 0.5rem; }
.admin-notice p { font-size: 0.875rem; color: var(--muted); }
.admin-notice code { color: var(--danger); background: rgba(239,68,68,0.1); padding: 0.125rem 0.375rem; border-radius: 4px; }

.back-link { display: block; text-align: center; margin-top: 1.5rem; color: var(--muted); text-decoration: none; font-size: 0.875rem; }
.back-link:hover { color: var(--text); }

/* Dashboard */
.dashboard { padding: 2rem; max-width: 1200px; margin: 0 auto; }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; margin-top: 2rem; }
.stat-card { background: var(--surface); padding: 1.5rem; border-radius: 12px; text-align: center; }
.stat-card h3 { color: var(--muted); font-size: 0.875rem; margin-bottom: 0.5rem; }
.big { font-size: 2.5rem; font-weight: 700; color: var(--accent); }

#userEmail { color: var(--muted); font-size: 0.875rem; margin-left: 2rem; }
