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

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

:root {
    --bg:       #0d0d0f;
    --bg2:      #111114;
    --bg3:      #1a1a1f;
    --bg4:      #222228;
    --border:   rgba(255,255,255,0.06);
    --border2:  rgba(255,255,255,0.1);
    --accent:   #00c896;
    --accent2:  #00e5a8;
    --text:     #f0f0f0;
    --text2:    #6b6b78;
    --text3:    #9a9aa8;
    --success:  #00c896;
    --danger:   #ff4455;
    --warning:  #f5a623;
    --mono:     'JetBrains Mono', monospace;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

/* ── Navbar ── */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1.5rem;
    height: 56px;
    background: var(--bg2);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--text);
}

.logo span { color: var(--accent); }

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

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 1rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    letter-spacing: 0.01em;
    transition: all 0.15s;
    white-space: nowrap;
}

.btn-primary {
    background: var(--accent);
    color: #000;
}
.btn-primary:hover { background: var(--accent2); }

.btn-secondary {
    background: var(--bg4);
    color: var(--text3);
    border: 1px solid var(--border2);
}
.btn-secondary:hover { background: var(--bg3); color: var(--text); }

.btn-steam {
    background: #1a1a2e;
    color: var(--text);
    border: 1px solid var(--border2);
}
.btn-steam:hover { border-color: var(--accent); color: var(--accent); }

.btn-danger {
    background: rgba(255,68,85,0.1);
    color: var(--danger);
    border: 1px solid rgba(255,68,85,0.2);
}
.btn-danger:hover { background: var(--danger); color: #fff; }

.btn-large {
    padding: 0.75rem 2rem;
    font-size: 0.9rem;
    border-radius: 4px;
}

/* ── ELO Badge ── */
.elo-badge {
    background: var(--bg4);
    color: var(--accent);
    padding: 0.2rem 0.6rem;
    border-radius: 3px;
    font-size: 0.75rem;
    font-weight: 700;
    font-family: var(--mono);
    border: 1px solid rgba(0,200,150,0.2);
}

/* ── Sidebar ── */
.app-layout {
    display: flex;
    min-height: calc(100vh - 56px);
}

.sidebar {
    width: 220px;
    background: var(--bg2);
    border-right: 1px solid var(--border);
    padding: 1rem 0;
    position: fixed;
    top: 56px;
    left: 0;
    height: calc(100vh - 56px);
    display: flex;
    flex-direction: column;
    z-index: 50;
}

.sidebar-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 0 0.5rem;
}

.sidebar-bottom {
    padding: 0.5rem;
    border-top: 1px solid var(--border);
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.55rem 0.75rem;
    border-radius: 4px;
    color: var(--text2);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.1s;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    margin-bottom: 1px;
}

.sidebar-item:hover {
    background: var(--bg3);
    color: var(--text3);
}

.sidebar-item.active {
    background: var(--bg3);
    color: var(--text);
}

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

.sidebar-icon {
    font-size: 1rem;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.sidebar-item.donate { color: var(--text2); }
.sidebar-item.donate:hover { color: var(--warning); background: rgba(245,166,35,0.05); }

.sidebar-item.admin { color: var(--text2); }
.sidebar-item.admin:hover { color: var(--danger); background: rgba(255,68,85,0.05); }

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 0.75rem;
    margin: 0 0.5rem 0.75rem;
    background: var(--bg3);
    border-radius: 4px;
    cursor: pointer;
    border: 1px solid var(--border);
    transition: all 0.1s;
}

.sidebar-user:hover { border-color: var(--border2); }

.sidebar-user img {
    width: 32px;
    height: 32px;
    border-radius: 3px;
}

.sidebar-user-info { flex: 1; overflow: hidden; }

.sidebar-username {
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-elo {
    font-size: 0.7rem;
    color: var(--accent);
    font-family: var(--mono);
    font-weight: 600;
}

.sidebar-divider {
    height: 1px;
    background: var(--border);
    margin: 0.4rem 0.5rem;
}

.main-content {
    margin-left: 220px;
    flex: 1;
    width: calc(100% - 220px);
}

/* ── Hero ── */
.hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 56px);
    text-align: center;
    gap: 1.25rem;
    padding: 2rem;
}

.hero h1 {
    font-size: 2.25rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--text);
    line-height: 1.1;
}

.hero p { color: var(--text2); font-size: 0.9rem; }

.queue-status {
    background: var(--bg3);
    padding: 0.5rem 1.25rem;
    border-radius: 3px;
    border: 1px solid var(--border);
    color: var(--text2);
    font-size: 0.8rem;
    font-family: var(--mono);
}

/* ── Modal ── */
.modal {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.modal-content {
    background: var(--bg2);
    padding: 1.75rem;
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    min-width: 320px;
    border: 1px solid var(--border2);
}

.modal-content h2 {
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.modal-content input,
.modal-content select {
    padding: 0.6rem 0.75rem;
    background: var(--bg3);
    border: 1px solid var(--border2);
    border-radius: 4px;
    color: var(--text);
    font-size: 0.85rem;
    font-family: 'Inter', sans-serif;
}

.modal-content input:focus,
.modal-content select:focus {
    outline: none;
    border-color: var(--accent);
}

/* ── Leaderboard ── */
.leaderboard-container {
    max-width: 760px;
    margin: 2rem auto;
    padding: 0 1.5rem;
}

.leaderboard-container h2 {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text2);
    font-size: 0.75rem;
}

.leaderboard-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--bg2);
    border-radius: 4px;
    margin-bottom: 2px;
    border: 1px solid var(--border);
    transition: border-color 0.1s;
}

.leaderboard-item:hover { border-color: var(--border2); }

.leaderboard-rank {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text2);
    width: 36px;
    font-family: var(--mono);
}

.leaderboard-item img {
    width: 32px;
    height: 32px;
    border-radius: 3px;
}

.leaderboard-username {
    flex: 1;
    font-weight: 600;
    font-size: 0.875rem;
}

.leaderboard-elo {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--accent);
    font-family: var(--mono);
}

/* ── Server connect ── */
.server-connect {
    background: var(--bg3);
    padding: 0.75rem 1rem;
    border-radius: 4px;
    font-family: var(--mono);
    font-size: 0.9rem;
    color: var(--accent);
    border: 1px solid var(--border2);
}

/* ── Notifications panel ── */
.notifications-panel {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    width: 300px;
    z-index: 500;
}

.notification {
    background: var(--bg2);
    border: 1px solid var(--border2);
    border-radius: 4px;
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
    font-size: 0.8rem;
    color: var(--text3);
}

/* ── Misc ── */
.error { color: var(--danger); font-size: 0.8rem; }
.page { min-height: calc(100vh - 56px); }

#navUsername {
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text3);
}

#navUser {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* ── Mobile ── */
@media (max-width: 768px) {
    .sidebar { width: 52px; }
    .sidebar-item span:not(.sidebar-icon) { display: none; }
    .sidebar-username, .sidebar-elo, .sidebar-user-info { display: none; }
    .sidebar-user { justify-content: center; padding: 0.5rem; }
    .sidebar-user img { width: 28px; height: 28px; }
    .main-content { margin-left: 52px; width: calc(100% - 52px); }
    .hero h1 { font-size: 1.6rem; }
}
