@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;700&family=Space+Grotesk:wght@400;500;600;700&display=swap');

:root {
    --bg: #050505;
    --bg-card: #0a0a0a;
    --bg-surface: #111111;
    --bg-hover: #1a1a1a;
    --green: #00ff41;
    --green-dim: #00cc33;
    --green-glow: rgba(0, 255, 65, 0.15);
    --green-subtle: rgba(0, 255, 65, 0.06);
    --red: #ff4444;
    --amber: #ffaa00;
    --blue: #5865f2;
    --cyan: #00ffff;
    --text: #e0e0e0;
    --text-dim: #888888;
    --text-muted: #555555;
    --border: #1a1a1a;
    --border-bright: #333333;
    --font-mono: 'JetBrains Mono', 'Courier New', monospace;
    --font-sans: 'Space Grotesk', sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-mono);
    font-size: 14px;
    line-height: 1.6;
    min-height: 100vh;
}

a { color: var(--green); text-decoration: none; transition: opacity 0.2s; }
a:hover { opacity: 0.8; }

::selection { background: var(--green); color: var(--bg); }

/* ========== NAV ========== */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(5, 5, 5, 0.9);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding: 0 2rem;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-brand {
    font-size: 16px;
    font-weight: 700;
    color: var(--green);
    letter-spacing: 1px;
}

.nav-brand span { color: var(--text-dim); }

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

.nav-links a {
    color: var(--text-dim);
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    transition: color 0.2s;
}
.nav-links a:hover, .nav-links a.active { color: var(--green); opacity: 1; }

.nav-user {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid var(--border-bright);
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 8px 20px;
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 600;
    border: 1px solid var(--green);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-primary {
    background: var(--green);
    color: var(--bg);
}
.btn-primary:hover { background: #00dd38; color: var(--bg); opacity: 1; }

.btn-outline {
    background: transparent;
    color: var(--green);
}
.btn-outline:hover { background: var(--green-glow); opacity: 1; }

.btn-discord {
    background: var(--blue);
    color: #fff;
    border-color: var(--blue);
}
.btn-discord:hover { background: #4752c4; color: #fff; opacity: 1; }

.btn-sm { padding: 6px 14px; font-size: 12px; }

/* ========== LAYOUT ========== */
.page { padding-top: 56px; min-height: 100vh; }
.container { max-width: 960px; margin: 0 auto; padding: 0 1.5rem; }
.section { padding: 4rem 0; }

/* ========== HERO ========== */
.hero {
    padding: 6rem 0 4rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--green-glow) 0%, transparent 70%);
    pointer-events: none;
}

.hero-label {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 3px;
    margin-bottom: 1.5rem;
}

.hero h1 {
    font-family: var(--font-sans);
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 700;
    color: var(--green);
    line-height: 1.1;
    margin-bottom: 0.5rem;
    position: relative;
}

.hero h1 .cursor {
    display: inline-block;
    width: 3px;
    height: 0.8em;
    background: var(--green);
    margin-left: 4px;
    animation: blink 1s step-end infinite;
    vertical-align: baseline;
}

@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

.hero-sub {
    font-size: 16px;
    color: var(--text-dim);
    max-width: 500px;
    margin: 1rem auto 2.5rem;
    line-height: 1.7;
}

.hero-ctas {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.hero-stats {
    display: flex;
    gap: 3rem;
    justify-content: center;
    margin-top: 3.5rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

.hero-stat {
    text-align: center;
}

.hero-stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--green);
}

.hero-stat-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 4px;
}

/* ========== TERMINAL BLOCK ========== */
.terminal {
    background: var(--bg-card);
    border: 1px solid var(--border-bright);
    border-radius: 8px;
    max-width: 620px;
    margin: 0 auto 2rem;
    overflow: hidden;
}

.terminal-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
}

.terminal-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}
.terminal-dot.r { background: #ff5f57; }
.terminal-dot.y { background: #ffbd2e; }
.terminal-dot.g { background: #28c840; }

.terminal-body {
    padding: 16px 20px;
    font-size: 13px;
    color: var(--text-dim);
    line-height: 1.8;
}

.terminal-body .prompt { color: var(--green); }
.terminal-body .cmd { color: var(--text); }
.terminal-body .out { color: var(--text-dim); }
.terminal-body .flag { color: var(--amber); }

/* ========== CARDS ========== */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.25rem;
    transition: border-color 0.2s;
}
.card:hover { border-color: var(--border-bright); }

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

/* ========== STAT CARDS ========== */
.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--green);
}

.stat-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 4px;
}

/* ========== TIER SECTIONS ========== */
.tier-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.tier-icon {
    font-size: 14px;
    font-weight: 700;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    border: 1px solid var(--border-bright);
}

.tier-beginner .tier-icon { color: var(--green); border-color: rgba(0,255,65,0.3); }
.tier-intermediate .tier-icon { color: var(--amber); border-color: rgba(255,170,0,0.3); }
.tier-advanced .tier-icon { color: var(--red); border-color: rgba(255,68,68,0.3); }

.tier-name {
    font-size: 16px;
    font-weight: 600;
}

.tier-count {
    font-size: 12px;
    color: var(--text-muted);
    margin-left: auto;
}

/* ========== LAB CARD ========== */
.lab-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: border-color 0.2s, background 0.2s;
}
.lab-card:hover { border-color: var(--border-bright); background: var(--bg-surface); }

.lab-status {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}
.lab-status.done { background: var(--green); box-shadow: 0 0 6px var(--green-glow); }
.lab-status.open { background: var(--text-muted); }

.lab-info { flex: 1; min-width: 0; }

.lab-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

.lab-meta {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
    display: flex;
    gap: 0.75rem;
}

.lab-time {
    font-size: 12px;
    color: var(--text-dim);
    white-space: nowrap;
}

.lab-difficulty { color: var(--amber); font-size: 12px; letter-spacing: 1px; }

/* ========== PROFILE ========== */
.profile-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 2px solid var(--green);
    box-shadow: 0 0 20px var(--green-glow);
}

.profile-name {
    font-family: var(--font-sans);
    font-size: 28px;
    font-weight: 700;
    color: var(--text);
}

.profile-rank {
    font-size: 14px;
    font-weight: 600;
    margin-top: 4px;
}

.profile-url {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ========== LEADERBOARD ========== */
.lb-entry {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    transition: background 0.15s;
}
.lb-entry:hover { background: var(--bg-surface); }
.lb-entry:last-child { border-bottom: none; }

.lb-pos {
    width: 32px;
    font-size: 16px;
    font-weight: 700;
    text-align: center;
    color: var(--text-muted);
}
.lb-pos.gold { color: #ffd700; }
.lb-pos.silver { color: #c0c0c0; }
.lb-pos.bronze { color: #cd7f32; }

.lb-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid var(--border-bright);
}

.lb-name {
    flex: 1;
    font-weight: 500;
    color: var(--text);
}

.lb-stats {
    display: flex;
    gap: 1.5rem;
    font-size: 12px;
    color: var(--text-dim);
}

.lb-stat-val { color: var(--green); font-weight: 600; }

/* ========== TIER PROGRESS BAR ========== */
.progress-bar {
    width: 100%;
    height: 6px;
    background: var(--bg-surface);
    border-radius: 3px;
    overflow: hidden;
    margin-top: 6px;
}

.progress-fill {
    height: 100%;
    border-radius: 3px;
    background: var(--green);
    transition: width 0.4s ease;
}

.progress-fill.intermediate { background: var(--amber); }
.progress-fill.advanced { background: var(--red); }

/* ========== BLOOD CARD ========== */
.blood-entry {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}
.blood-entry:last-child { border-bottom: none; }

.blood-lab { color: var(--text); font-weight: 500; }
.blood-user { color: var(--red); }
.blood-unclaimed { color: var(--text-muted); font-style: italic; }

/* ========== SECTION HEADERS ========== */
.section-title {
    font-family: var(--font-sans);
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.25rem;
}

.section-sub {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

/* ========== FOOTER ========== */
.footer {
    border-top: 1px solid var(--border);
    padding: 2rem 0;
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
}

.footer a { color: var(--text-dim); }

/* ========== 404 ========== */
.error-page {
    text-align: center;
    padding: 8rem 0;
}

.error-code {
    font-size: 72px;
    font-weight: 700;
    color: var(--green);
    line-height: 1;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 640px) {
    .hero { padding: 4rem 0 3rem; }
    .hero h1 { font-size: 2rem; }
    .hero-stats { gap: 1.5rem; flex-wrap: wrap; }
    .stats-row { grid-template-columns: repeat(2, 1fr); }
    .profile-header { flex-direction: column; text-align: center; }
    .lb-stats { gap: 0.75rem; }
    .nav-links a.hide-mobile { display: none; }
}

/* ========== SCANLINE ANIMATION ========== */
@keyframes scanline {
    0% { transform: translateY(-100%); }
    100% { transform: translateY(100vh); }
}

.scanline {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--green-glow), transparent);
    animation: scanline 8s linear infinite;
    pointer-events: none;
    z-index: 999;
    opacity: 0.3;
}

/* ========== TABS ========== */
.tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1.5rem;
}

.tab {
    padding: 0.75rem 1.25rem;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
    background: none;
    border-top: none;
    border-left: none;
    border-right: none;
    font-family: var(--font-mono);
}
.tab:hover { color: var(--text-dim); }
.tab.active { color: var(--green); border-bottom-color: var(--green); }

/* ========== OG SHARE CARD STYLING ========== */
.share-url {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 12px;
    color: var(--text-dim);
    margin-top: 0.75rem;
    max-width: 400px;
}

.share-url code {
    flex: 1;
    color: var(--green);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.copy-btn {
    background: none;
    border: 1px solid var(--border-bright);
    color: var(--text-dim);
    padding: 4px 10px;
    font-size: 11px;
    border-radius: 4px;
    cursor: pointer;
    font-family: var(--font-mono);
    transition: all 0.2s;
}
.copy-btn:hover { border-color: var(--green); color: var(--green); }