/* ========== ОБЩИЕ СТИЛИ ========== */
* {
    box-sizing: border-box;
}
body {
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    background: #0b0d12;
    margin: 0;
    padding: 0;
    color: #eef2ff;
    overflow-x: hidden;
}

/* ========== НАВИГАЦИЯ (плоский дизайн, острые углы) ========== */
nav {
    position: sticky;
    top: 0;
    left: 0;
    width: 100%;
    backdrop-filter: blur(10px);
    background: rgba(15, 17, 23, 0.95);
    border-bottom: 1px solid #242832;
    z-index: 10010;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 1rem;
    padding: 0.4rem 5%;
    height: 56px;
}

.nav-left {
    justify-self: start;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 1.4rem;
    color: #eef2ff;
    line-height: 1;
}
.nav-left img {
    width: 28px;
    height: 28px;
    border-radius: 50%;
}

.nav-center {
    justify-self: center;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    align-items: center;
}
.nav-center a,
.nav-center button {
    color: #eef2ff;
    text-decoration: none;
    font-weight: 500;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.95rem;
    white-space: nowrap;
    position: relative;
    line-height: 1;
}
.nav-center a:hover,
.nav-center button:hover {
    color: #4489c1;
}
.nav-center a.active,
.nav-center button.active {
    color: #4489c1;
}
/* Полоска активной страницы – внизу навбара */
.nav-center a.active::after,
.nav-center button.active::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -18px;
    width: 100%;
    height: 2px;
    background: #4489c1;
    pointer-events: none;
}

.nav-right {
    justify-self: end;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: flex-end;
    max-width: 100%;
}

#user {
    display: flex;
    align-items: center;
    gap: 0px;
    color: #8a92a6;
    position: relative;
}

.user-clickable {
    position: relative;  /* ← добавляем */
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 8px;
    background: transparent;
    transition: background 0.1s, color 0.1s;
}
.user-clickable:hover {
    background: rgba(68, 137, 193, 0.1);
    color: #4489c1;
}
#user img {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    margin-right: 2px !important;
}

/* Бейджи балансов */
.points-badge,
.silver-badge {
    
    padding: 2px 8px;
    margin-left: 8px;
    font-size: 0.8rem;
}
.points-badge i { color: #ffd700; }
.silver-badge i { color: #c0c0c0; }
#discord-modal {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #12151c;
  color: white;
  padding: 25px;
  border: 1px solid #2a2e3a;
  z-index: 2000;
  width: 90%;
  max-width: 500px;
}
#discord-modal h3 {
  color: #4489c1;
  margin-top: 0;
}
#discord-modal code {
  background: #23272a;
  padding: 4px 8px;
  word-break: break-all;
}
#discord-modal button {
  background: #4489c1;
  border: none;
  padding: 6px 12px;
  color: white;
  cursor: pointer;
}
#discord-modal button:hover {
  background: #5d9ed6;
}
#modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 1999;
}
/* Выпадающее меню */
.user-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    right: auto;
    width: max-content;
    min-width: 100%;
    background: #12151c;
    border: 1px solid #242832;
    z-index: 1001;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s, visibility 0.15s;
    pointer-events: none;
}
.user-dropdown.show {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}
.user-dropdown a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    color: #eef2ff;
    text-decoration: none;
    white-space: nowrap;
}
.user-dropdown a i {
    width: 20px;
    text-align: center;
}
.user-dropdown a:hover {
    background: #4489c1;
    color: white;
}

/* Кнопка "Войти" */
.nav-right #login {
    background: transparent !important;
    border: none !important;
    color: #eef2ff !important;
    font-size: 1rem !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    padding: 0 12px !important;
}
.nav-right #login:hover {
    color: #4489c1 !important;
}

/* Скрываем старые кнопки */
#participate, #logout {
    display: none !important;
}

/* Модальное окно обмена валюты (плоское) */
.exchange-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10001;
    background: #12151c;
    border: 1px solid #4489c1;
    max-width: 450px;
    width: 90%;
}
.exchange-modal-content {
    padding: 1.5rem;
}
.exchange-close {
    float: right;
    font-size: 24px;
    cursor: pointer;
    color: #8a92a6;
}
.exchange-close:hover {
    color: #4489c1;
}
.exchange-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    z-index: 10000;
}
button, #exchangeConfirmBtn {
    background: #4489c1;
    border: none;
    padding: 8px 14px;
    color: white;
    font-weight: 500;
    cursor: pointer;
}
button:hover, #exchangeConfirmBtn:hover {
    background: #5d9ed6;
}

/* Адаптивность */
@media (max-width: 768px) {
    nav {
        display: flex;
        flex-wrap: wrap;
        justify-content: space-between;
        gap: 0.5rem;
        padding: 0.3rem 5%;
        height: auto;
    }
    .user-dropdown {
        top: calc(100% + 4px);
        width: max-content;
        min-width: 100%;
        left: 0;
        right: auto;
    }
    .nav-left { order: 1; font-size: 1.2rem; }
    .nav-right { order: 2; }
    .nav-center { order: 3; width: 100%; justify-content: center; margin-top: 4px; gap: 0.4rem 0.8rem; }
    .nav-center a, .nav-center button { font-size: 0.85rem; }
    .nav-center a.active::after,
    .nav-center button.active::after {
        bottom: -12px;
    }
    button, #login, #logout, #participate { padding: 6px 12px; font-size: 0.8rem; }
}
@media (max-width: 480px) {
    .nav-left b { font-size: 1rem; }
    .nav-left img { width: 24px; height: 24px; }
    #user img { width: 24px; height: 24px; }
    .nav-center a.active::after,
    .nav-center button.active::after {
        bottom: -12px;
    }
}
.nav-right #login,
.nav-right #login:hover,
.nav-right #login:focus,
.nav-right #login:active {
    text-decoration: none !important;
    border-bottom: none !important;
}

.nav-right #login::after {
    display: none !important;
}