:root {
    --bg-main: #05060a;
    --bg-header: #0b0d12;
    --bg-card: #10131c;
    --bg-card-soft: #171b26;
    --border-soft: #232732;
    --accent: #00d9ff;
    --accent-soft: rgba(0, 217, 255, 0.15);
    --text-main: #ffffff;
    --text-muted: #9ea3b4;
    --danger: #ff4b6b;
    --success: #4cd964;
}

/* Сброс */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    min-height: 100%;
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: radial-gradient(circle at top, #10131c 0, #05060a 45%, #020308 100%) fixed;
    color: var(--text-main);
    -webkit-font-smoothing: antialiased;
    background-repeat: no-repeat;
    background-size: cover;
}

a {
    color: inherit;
    text-decoration: none;
}

main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 20px 40px;
}

/* ========= Header ========= */

.header {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
    background: rgba(5, 6, 10, 0.96);
    border-bottom: 1px solid var(--border-soft);
    backdrop-filter: blur(12px);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 32px;
}

.logo {
    font-weight: 900;
    font-size: 20px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #fff;
}

.logo span {
    margin-left: 4px;
    font-weight: 700;
    font-size: 14px;
    padding: 2px 6px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--accent), #4b8bff);
    color: #020308;
}

/* === ДЕСКТОП МЕНЮ ВСЕГДА ВИДИМО === */
.nav-desktop {
    display: flex;
    align-items: center;
    gap: 16px;
}

.nav-desktop a {
    font-size: 14px;
    padding: 8px 12px;
    border-radius: 999px;
    color: var(--text-muted);
    transition: 0.15s ease;
}

.nav-desktop a:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.04);
}

/* auth */

.auth {
    display: flex;
    align-items: center;
    gap: 16px;
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--accent);
    object-fit: cover;
}

.user-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 13px;
}

.user-name { font-weight: 600; }

.user-rank {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--accent);
}

.user-balance {
    font-size: 13px;
    font-weight: 600;
}

/* ========= Buttons ========= */

.btn,
.btn-login,
.btn-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 16px;
    border-radius: 999px;
    border: 1px solid transparent;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.16s ease;
    background: transparent;
    color: #fff;
}

.btn {
    background: linear-gradient(135deg, var(--accent), #4b8bff);
    color: #020308;
}

.btn:hover {
    filter: brightness(1.05);
    transform: translateY(-1px);
}

.btn-outline {
    border-color: var(--border-soft);
    background: rgba(255, 255, 255, 0.01);
}

.btn-outline:hover {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent-soft);
}

.btn-login {
    background: var(--accent-soft);
    border-color: var(--accent);
    color: var(--accent);
}

.btn-login:hover {
    background: var(--accent);
    color: #020308;
}

/* ========= Общий контент ========= */

.title {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 8px;
}

.subtitle {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 22px;
}

.grid-card {
    background: var(--bg-card);
    border-radius: 18px;
    padding: 18px 18px 16px;
    border: 1px solid var(--border-soft);
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.6);
}

.grid-card h3 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 12px;
}

.text-muted { color: var(--text-muted); font-size: 13px; }

/* Flash */
.flash-list {
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.flash {
    border-radius: 999px;
    padding: 8px 12px;
    font-size: 13px;
    border: 1px solid var(--border-soft);
    background: rgba(0, 0, 0, 0.35);
}

/* Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-top: 18px;
}

/* Balance layout */
.balance-layout {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 22px;
}

/* ========= Скрываем мобильные элементы на ПК ========= */

.nav-more,
.nav-mobile {
    display: none;
}

/* FIX: на ПК header не должен переносить элементы */
@media (min-width: 901px) {
    .header {
        flex-wrap: nowrap !important;
        height: 72px; /* ровный аккуратный хедер */
        padding: 10px 24px;
    }

    .auth {
        flex-wrap: nowrap !important;
        gap: 16px;
    }

    .auth-left,
    .auth-right {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        gap: 12px !important;
    }

    /* ВЫРАВНИВАЕМ КНОПКИ В ОДНУ ЛИНИЮ */
    .auth-actions {
        display: flex;
        flex-direction: row !important;
        gap: 10px;
        white-space: nowrap;
    }
}
