:root {
    --bg: #0b0d12;
    --panel: #121720;
    --border: #252d3b;
    --text: #f3f5f8;
    --muted: #97a3b6;
    --radius: 14px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: Inter, Segoe UI, Roboto, system-ui, sans-serif;
}

body {
    background: radial-gradient(circle at 20% 0%, #131824 0%, #0b0d12 45%, #090b0f 100%);
    color: var(--text);
    min-height: 100vh;
    padding: 24px;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
}

.blitz-header,
.panel {
    border: 1px solid var(--border);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0));
    border-radius: var(--radius);
}

.quick-nav {
    position: sticky;
    top: 10px;
    z-index: 120;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    padding: 10px 12px;
    border: 1px solid var(--border);
    background: linear-gradient(180deg, rgba(18, 23, 32, 0.86), rgba(18, 23, 32, 0.68));
    backdrop-filter: blur(10px);
    border-radius: var(--radius);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.32);
    margin-bottom: 18px;
}

.quick-nav-account {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.quick-nav-btn {
    display: inline-flex;
    align-items: center;
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.02);
    color: var(--muted);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: 0.2s ease;
}

.quick-nav-btn:hover {
    border-color: #3a4b67;
    color: var(--text);
    background: rgba(110, 168, 254, 0.08);
}

.blitz-header {
    padding: 18px;
    margin-bottom: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

h1 {
    font-size: 1.9rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.logo h1 {
    font-size: 1.9rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.logo span {
    display: inline-flex;
    margin-top: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    color: var(--muted);
    border: 1px solid var(--border);
    font-size: 0.82rem;
}

label {
    color: var(--muted);
}

.subtitle {
    display: inline-flex;
    margin-top: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    color: var(--muted);
    border: 1px solid var(--border);
    font-size: 0.82rem;
}

.panel {
    padding: 16px;
    margin-bottom: 14px;
}


.user-panel {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.global-handle-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 8px 12px;
    background: transparent;
    color: var(--text);
    text-decoration: none;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
}

html:not([data-auth-chip-ready="1"]) .global-handle-chip[data-global-handle-chip] {
    visibility: hidden;
}

.global-handle-chip.not-verified {
    display: inline-block;
    background: linear-gradient(180deg,#60a5fa,#3b82f6);
    color: #071325;
    border-color: rgba(59,130,246,0.28);
    font-weight: 700;
    border-radius: 10px;
    padding: 8px 12px;
    font-size: 13.3333px;
    line-height: normal;
    transition: transform 140ms ease, box-shadow 140ms ease;
}

.global-handle-chip.not-verified:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(59,130,246,0.12); }

.global-handle-avatar {
    width: 24px;
    height: 24px;
    border-radius: 999px;
    border: 1px solid var(--border);
    object-fit: cover;
}

.nav-btn {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 9px 12px;
    text-decoration: none;
    background: #1b2232;
    color: var(--text);
    font-weight: 600;
    cursor: pointer;
}

.search-grid {
    display: grid;
    grid-template-columns: minmax(260px, 420px) auto;
    justify-content: start;
    gap: 8px;
    align-items: end;
}

.profile-tip {
    margin-top: 10px;
    color: var(--muted);
    font-size: 0.88rem;
}

.all-profiles-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.all-profiles-head h3 {
    font-size: 1rem;
}

.profile-count {
    color: var(--muted);
    font-size: 0.85rem;
}

.all-profiles-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.profile-chip {
    border: 1px solid var(--border);
    background: #141b27;
    color: #9dc4ff;
    text-decoration: none;
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 0.85rem;
    font-weight: 600;
}

.profile-chip.active {
    border-color: #5acb8a;
    color: #5acb8a;
}

label {
    display: block;
    font-size: 0.85rem;
    margin-bottom: 6px;
}

input {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--panel);
    color: var(--text);
    padding: 10px 12px;
}

.profile-body {
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--panel);
    padding: 12px;
}

.user-profile-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.user-profile-head-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    min-width: 0;
    text-align: left;
}

.user-profile-handle-row {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    width: 100%;
}

.user-profile-avatar {
    width: 44px;
    height: 44px;
    border-radius: 999px;
    border: 1px solid var(--border);
    object-fit: cover;
}

.user-profile-handle {
    font-size: 1.05rem;
    font-weight: 700;
}

.user-profile-rank {
    color: var(--muted);
    font-size: 0.9rem;
}

.profile-blocked-banner {
    margin: 8px 0 10px;
    border: 1px solid #9f4a4a;
    background: #3a1f1f;
    color: #ffd5d5;
    border-radius: 10px;
    padding: 8px 10px;
    font-size: 0.86rem;
}

.user-presence {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    margin-top: 2px;
}

.presence-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    display: inline-block;
    background: #8a8f99;
}

.user-presence.status-active {
    color: #5acb8a;
}

.user-presence.status-active .presence-dot {
    background: #5acb8a;
}

.user-presence.status-offline {
    color: var(--muted);
}

.user-profile-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(120px, 1fr));
    gap: 8px;
}

.user-profile-item {
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #141b27;
    padding: 8px 10px;
}

.user-profile-item span {
    display: block;
    color: var(--muted);
    font-size: 0.78rem;
    margin-bottom: 4px;
}

.user-profile-item strong {
    font-size: 0.95rem;
}

.user-profile-links {
    margin-top: 10px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.user-profile-links a,
.user-stats-handle,
.user-recent-link {
    color: #9dc4ff;
    text-decoration: none;
    font-weight: 600;
}

.user-profile-logout-btn {
        display: flex;
        align-items: center;
        justify-content: center;
    border: 1px solid #ff7d7d;
    background: linear-gradient(180deg, #ff9a9a, #ff7d7d);
    color: #230505;
    border-radius: 999px;
    padding: 4px 10px;
    font-weight: 700;
    cursor: pointer;
}

.user-profile-actions {
    margin-top: 12px;
    display: flex;
    justify-content: flex-end;
}

.user-profile-logout-btn:hover {
    filter: brightness(1.05);
}

.user-profile-site {
    margin-top: 10px;
    border-top: 1px solid var(--border);
    padding-top: 10px;
}

.user-profile-site h4 {
    font-size: 0.9rem;
    margin-bottom: 8px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.user-recent-wrap {
    margin-top: 10px;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 8px;
    background: #141b27;
}

.user-recent-title {
    font-size: 0.82rem;
    color: var(--muted);
    margin-bottom: 6px;
}

.user-recent-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.user-recent-item {
    display: grid;
    grid-template-columns: auto 1fr auto auto;
    gap: 8px;
    align-items: center;
    font-size: 0.86rem;
}

.user-recent-opponent {
    color: var(--text);
}

.user-recent-outcome {
    min-width: 22px;
    text-align: center;
    border-radius: 999px;
    padding: 1px 6px;
    border: 1px solid var(--border);
    font-weight: 700;
}

.user-recent-outcome.win { color: #5acb8a; }
.user-recent-outcome.loss { color: #ff7d7d; }
.user-recent-outcome.tie { color: #9dc4ff; }

.user-recent-score,
.user-recent-empty {
    color: var(--muted);
}

.rank-newbie { color: #8a8f99; }
.rank-pupil { color: #74ca77; }
.rank-specialist { color: #4bc7b8; }
.rank-expert { color: #6ea8fe; }
.rank-cm { color: #c67bf3; }
.rank-master,
.rank-im { color: #ffb86a; }
.rank-gm,
.rank-lgm { color: #ff7d7d; }

.site-footer {
    margin-top: 6px;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0));
    color: var(--muted);
    text-align: center;
    line-height: 1.5;
    font-size: 0.9rem;
}

/* Tabs for profile page */
.tabs {
    display:flex;
    gap:8px;
    margin-bottom:12px;
}
.tab-btn {
    border: 1px solid var(--border);
    background: rgba(255,255,255,0.02);
    color: var(--muted);
    padding: 8px 12px;
    border-radius: 999px;
    cursor: pointer;
    font-weight: 700;
}
.tab-btn.active {
    background: linear-gradient(180deg,#5acb8a,#2fa06a);
    color: #071325;
    border-color: rgba(90,203,138,0.12);
}
.tab-content { margin-top:8px; }
.tab-panel { display:block; }
.tab-panel:not(.active) { display:none; }


.site-footer a {
    color: #9dc4ff;
    text-decoration: none;
}

.site-version {
    margin-top: 2px;
    font-size: 0.72rem;
    opacity: 0.78;
    letter-spacing: 0.03em;
}

@media (max-width: 860px) {
    .blitz-header,
    .user-panel {
        flex-direction: column;
        align-items: flex-start;
    }

    .search-grid,
    .user-profile-grid {
        grid-template-columns: 1fr;
    }
}
