﻿/* ═══════════════════════════════
   TOPBAR
═══════════════════════════════ */
.topbar {
  position: sticky; top: 0; z-index: 160;
  height: 60px;
  background: rgba(3,11,24,0.88);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  border-bottom: 1px solid rgba(var(--accent-rgb),0.14);
  padding: 0 24px;
  display: flex; align-items: center; gap: 14px;
}

.logo {
  font-size: 20px; font-weight: 800; letter-spacing: 0.5px;
  background: var(--gradient-accent);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  flex-shrink: 0; text-decoration: none;
}
.logo em {
  background: linear-gradient(135deg, #cce8ff, #7ab8e8);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  font-style: normal;
}

/* ── Кнопка Игры ── */
.games-btn {
  display: flex; align-items: center; gap: 7px;
  padding: 0 13px; height: 36px; border-radius: 8px;
  background: rgba(var(--accent-rgb),0.08);
  border: 1px solid var(--border);
  color: var(--text-dim); font-size: 12px; font-weight: 700;
  letter-spacing: 0.8px; cursor: pointer; font-family: var(--font);
  transition: all 0.2s; flex-shrink: 0;
}
.games-btn:hover,
.games-btn.open {
  background: rgba(var(--accent-rgb),0.18);
  border-color: rgba(var(--accent-rgb),0.4);
  color: var(--accent);
}
.games-btn .gmb-arrow { transition: transform 0.22s; }
.games-btn.open .gmb-arrow { transform: rotate(180deg); }

/* ── Соцсети ── */
.topbar-socials { display: flex; gap: 2px; }
.tsoc {
  width: 32px; height: 32px; border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-mute); transition: all 0.15s;
}
.tsoc:hover { background: rgba(var(--accent-rgb),0.06); }
.tsoc.tg:hover { color: #2aabee; }
.tsoc.dc:hover { color: #7289da; }
.tsoc.yt:hover { color: #ff4040; }

/* ── Навигация ── */
.topbar-nav { display: flex; gap: 2px; }
.tnav {
  font-size: 13px; font-weight: 500; color: var(--text-dim);
  padding: 0 10px; height: 36px; display: flex; align-items: center;
  border-radius: 7px; transition: all 0.15s; white-space: nowrap;
}
.tnav:hover { color: var(--text); background: rgba(255,255,255,0.04); }

/* ── Правая часть ── */
.topbar-right { display: flex; align-items: center; gap: 8px; }

/* ── Баланс ── */
.balance-pill {
  display: flex; align-items: center; gap: 9px;
  background: rgba(var(--accent-rgb),0.08);
  border: 1px solid var(--border);
  border-radius: 10px; padding: 0 14px; height: 38px;
  cursor: default; transition: all 0.2s;
}
.balance-pill:hover { border-color: rgba(var(--accent-rgb),0.35); box-shadow: 0 0 18px rgba(var(--accent-rgb),0.14); }

.coin-icon {
  width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0;
  background: var(--gradient-accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 900; color: #fff;
  box-shadow: 0 0 14px rgba(var(--accent-rgb),0.55);
}
.balance-amount {
  font-size: 14px; font-weight: 700; color: var(--text);
  font-variant-numeric: tabular-nums; min-width: 64px;
}
.coin-info-btn { display: none; }

/* ── Пополнить ── */
.topbar-action-btn,
.btn-deposit {
  display: flex; align-items: center; gap: 6px;
  padding: 0 18px; height: 38px; border-radius: 9px;
  background: var(--gradient-accent);
  color: #fff; font-size: 12px; font-weight: 800;
  letter-spacing: 0.4px; cursor: pointer; border: none;
  font-family: var(--font); transition: all 0.2s;
  box-shadow: 0 4px 20px rgba(var(--accent-rgb),0.4);
  text-decoration: none; white-space: nowrap;
}
.topbar-action-btn:hover,
.btn-deposit:hover { transform: translateY(-1px); box-shadow: 0 6px 28px rgba(var(--accent-rgb),0.55); }

/* Вывести */
.topbar-btn-withdraw {
  background: rgba(var(--accent-rgb),0.08);
  border: 1px solid var(--border);
  color: var(--text-dim);
  box-shadow: none;
}
.topbar-btn-withdraw:hover {
  background: rgba(var(--accent-rgb),0.15);
  color: var(--text);
  transform: translateY(-1px);
  box-shadow: none;
}

/* ── Пользователь ── */
.user-widget, .user-pill {
  display: flex; align-items: center; gap: 9px;
  background: rgba(var(--accent-rgb),0.07);
  border: 1px solid var(--border);
  border-radius: 10px; padding: 0 12px 0 6px; height: 38px;
  cursor: pointer; transition: all 0.18s; position: relative;
  min-width: 160px;
}
.user-widget:hover, .user-pill:hover { background: rgba(var(--accent-rgb),0.13); border-color: var(--border-h); }

.user-avatar-wrap, .user-ava {
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; flex-shrink: 0;
}
.user-avatar { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; display: block; }

.user-widget-info { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.user-widget-top  { display: flex; align-items: center; gap: 6px; }

.user-nick, .user-name {
  font-size: 13px; font-weight: 600; color: var(--text);
  max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.user-level, .user-lvl {
  font-size: 10px; font-weight: 800; color: #fff;
  background: var(--gradient-accent);
  padding: 1px 6px; border-radius: 4px; white-space: nowrap; flex-shrink: 0;
}
.user-xp-bar {
  width: 100%; height: 3px;
  background: rgba(var(--accent-rgb),0.15); border-radius: 2px; overflow: hidden; margin-top: 3px;
}
.user-xp-fill { height: 100%; background: var(--gradient-accent); border-radius: 2px; transition: width 0.4s; }

.user-widget-arrow {
  margin-left: auto; flex-shrink: 0;
  color: var(--text-mute); transition: transform 0.2s, color 0.2s;
}
.user-widget:hover .user-widget-arrow { transform: rotate(180deg); color: var(--accent); }

/* ── Дропдаун ── */
.user-dropdown {
  display: none; position: absolute; top: 100%; right: 0;
  padding-top: 8px; min-width: 190px; z-index: 999;
}
.user-dropdown-inner {
  background: var(--bg-card);
  border: 1px solid rgba(var(--accent-rgb),0.18);
  border-radius: 12px; padding: 6px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.6), 0 0 0 1px rgba(var(--accent-rgb),0.06);
  backdrop-filter: blur(20px);
}
.user-widget:hover .user-dropdown { display: block; }
.user-dropdown-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 8px;
  color: var(--text-dim); font-size: 13px; text-decoration: none;
  cursor: pointer; transition: background 0.15s, color 0.15s;
}
.user-dropdown-item:hover { background: rgba(var(--accent-rgb),0.1); color: var(--text); }
.user-dropdown-item.adm-link { color: var(--gold); }
.user-dropdown-item.adm-link:hover { background: rgba(var(--accent-rgb),0.08); }
.user-dropdown-item svg { flex-shrink: 0; }
.user-dropdown-sep { height: 1px; background: rgba(var(--accent-rgb),0.1); margin: 4px 0; }

/* ── Колокольчик ── */
.notif-bell-wrap { position: relative; flex-shrink: 0; }

.notif-bell {
  width: 36px; height: 36px; border-radius: 8px;
  background: rgba(var(--accent-rgb),0.07); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all 0.18s; position: relative;
}
.notif-bell:hover { background: rgba(var(--accent-rgb),0.15); }
.notif-bell svg { color: var(--text-mute); transition: color 0.18s; }
.notif-bell:hover svg { color: var(--text-dim); }
.notif-bell.has-notif svg { color: var(--accent); }

.notif-bell-badge {
  position: absolute; top: -5px; right: -5px;
  min-width: 17px; height: 17px;
  background: #d4634a; color: #fff;
  font-size: 9px; font-weight: 800; font-family: var(--font);
  border-radius: 9px; padding: 0 4px;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--bg); line-height: 1; pointer-events: none;
  animation: notifBadgePop 0.25s cubic-bezier(.17,.67,.42,1.4);
}
@keyframes notifBadgePop {
  from { transform: scale(0); }
  to   { transform: scale(1); }
}

/* ── Дропдаун уведомлений ── */
.notif-dropdown {
  position: absolute; top: calc(100% + 10px); right: 0;
  width: 320px; background: var(--bg-card);
  border: 1px solid rgba(var(--accent-rgb),0.18);
  border-radius: 14px;
  box-shadow: 0 16px 48px rgba(0,0,0,0.7), 0 0 0 1px rgba(var(--accent-rgb),0.06);
  z-index: 450; display: none; overflow: hidden;
}
.notif-dropdown.open {
  display: block;
  animation: notifDropIn 0.18s cubic-bezier(.17,.67,.42,1.05);
}
@keyframes notifDropIn {
  from { opacity: 0; transform: translateY(-8px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0)    scale(1); }
}

.notif-drop-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 14px 10px;
  border-bottom: 1px solid rgba(var(--accent-rgb),0.1);
}
.notif-drop-title {
  font-size: 14px; font-weight: 800; color: #fff;
  letter-spacing: -0.3px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Inter, Roboto, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
.notif-drop-read-all {
  font-size: 11px; font-weight: 600; color: var(--accent);
  background: none; border: none; cursor: pointer; padding: 0;
  font-family: var(--font); opacity: 0.85; transition: opacity 0.15s;
}
.notif-drop-read-all:hover { opacity: 1; }

.notif-drop-list {
  max-height: 360px; overflow-y: auto; padding: 6px;
}
.notif-drop-list::-webkit-scrollbar { width: 4px; }
.notif-drop-list::-webkit-scrollbar-thumb { background: rgba(var(--accent-rgb),0.2); border-radius: 2px; }

.notif-empty {
  padding: 36px 16px; text-align: center;
  color: var(--text-mute); font-size: 13px;
}
.notif-empty-ico {
  margin: 0 auto 12px;
  width: 40px; height: 40px; border-radius: 12px;
  background: rgba(var(--accent-rgb),0.07);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-faint);
}

.notif-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 11px 12px; border-radius: 10px; cursor: default;
  background: rgba(255,255,255,0.018);
  border: 1px solid rgba(255,255,255,0.06);
  transition: background 0.15s, border-color 0.15s, transform 0.15s;
  position: relative;
}
.notif-item + .notif-item { margin-top: 6px; }
.notif-item:hover {
  background: rgba(var(--accent-rgb),0.07);
  border-color: rgba(var(--accent-rgb),0.28);
  transform: translateX(1px);
}
.notif-item.unread {
  background: rgba(var(--accent-rgb),0.06);
  border-color: rgba(var(--accent-rgb),0.32);
  box-shadow: inset 3px 0 0 var(--accent);
  padding-left: 14px;
}
.notif-item.unread:hover {
  background: rgba(var(--accent-rgb),0.10);
  border-color: rgba(var(--accent-rgb),0.45);
}

.notif-item-icon {
  width: 34px; height: 34px; border-radius: 9px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.notif-item-body  { flex: 1; min-width: 0; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Inter, Roboto, Arial, sans-serif; }
.notif-item-title {
  font-size: 13px; font-weight: 700; color: #fff;
  letter-spacing: -0.2px; line-height: 1.3; margin-bottom: 3px;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
.notif-item-text  {
  font-size: 12px; color: var(--text-dim); line-height: 1.5;
  font-weight: 500; letter-spacing: -0.1px;
  -webkit-font-smoothing: antialiased;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; word-break: break-word;
}
.notif-item-time  {
  font-size: 10px; color: var(--text-mute); margin-top: 5px;
  font-weight: 600; letter-spacing: 0.3px; text-transform: lowercase;
}
.notif-item-dot   {
  width: 7px; height: 7px; background: var(--accent);
  border-radius: 50%; flex-shrink: 0; margin-top: 5px;
}

/* ── Auth ── */
.auth-btn {
  display: flex; align-items: center; gap: 8px;
  background: var(--gradient-accent);
  color: #fff; font-size: 12px; font-weight: 800;
  letter-spacing: 1px; padding: 8px 20px; border-radius: 9px;
  text-decoration: none; transition: all 0.2s; white-space: nowrap; flex-shrink: 0;
  box-shadow: 0 4px 20px rgba(var(--accent-rgb),0.4);
}
.auth-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 28px rgba(var(--accent-rgb),0.55); }

/* ── Модалка валюты ── */
.coin-modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.7); z-index: 2000;
  align-items: center; justify-content: center;
  backdrop-filter: blur(8px);
}
.coin-modal-overlay.open { display: flex; }
.coin-modal {
  background: var(--bg-card); border: 1px solid rgba(var(--accent-rgb),0.2);
  border-radius: 16px; padding: 28px; min-width: 320px; max-width: 400px;
  position: relative; box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}
.coin-modal-title {
  font-size: 16px; font-weight: 700; color: var(--text); margin-bottom: 16px;
  display: flex; align-items: center; gap: 10px;
}
.coin-modal-close {
  position: absolute; top: 14px; right: 14px;
  background: none; border: none; color: var(--text-mute);
  font-size: 18px; cursor: pointer; line-height: 1; transition: color 0.2s;
}
.coin-modal-close:hover { color: var(--text); }

/* На десктопе сдвигаем основной контент, когда левый игровой рейл открыт.
   Транзишен общий с чатом — указан в chat.css на ту же выборку.
   Сдвигом управляет body.gsb-shifts — JS (updatePanelShifts) выставляет
   только когда рейл реально перекрывает полезный контент. */
@media (min-width: 901px) {
  /* Сдвигом контента управляет JS (updatePanelShifts) через body.gsb-shifts.
     Через :has(.gsb:not(.hidden)) запускать сдвиг нельзя — JS успевает
     включить body.panels-measuring (transition: none) и обрезает анимацию. */
  body.gsb-shifts .layout > main,
  body.gsb-shifts .layout > .page,
  body.gsb-shifts .layout > #dep,
  body.gsb-shifts .main {
    padding-left: 98px;
  }
}

/* ═══════════════════════════════
   GAMES SIDEBAR (overlay icon rail)
═══════════════════════════════ */
.gsb {
  width: 82px;
  position: fixed; top: 60px; left: 0;
  z-index: 1500;
  background: rgba(3,11,24,0.85);
  border-right: 1px solid rgba(var(--accent-rgb),0.1);
  border-top: 1px solid rgba(var(--accent-rgb),0.1);
  border-bottom: 1px solid rgba(var(--accent-rgb),0.1);
  border-radius: 0 14px 14px 0;
  display: flex; flex-direction: column;
  padding: 13px 7px; gap: 2px;
  backdrop-filter: blur(20px);
  box-shadow: 8px 0 30px rgba(0,0,0,0.45);
  transition:
    transform 0.28s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.22s ease,
    border-color 0.22s ease;
}
.gsb.hidden {
  transform: translateX(-100%);
  opacity: 0;
  border-color: transparent;
  pointer-events: none;
}
.gsb-item {
  display: flex; flex-direction: column; align-items: center;
  gap: 5px; padding: 10px 4px; border-radius: 11px;
  cursor: pointer; transition: background 0.15s, opacity 0.2s ease; text-decoration: none;
  position: relative;
}
.gsb.hidden .gsb-item { opacity: 1; }
.gsb-item:hover { background: rgba(var(--accent-rgb),0.08); }
.gsb-item.active { background: color-mix(in srgb, var(--c) 12%, transparent); }
.gsb-item.active::before {
  content: ''; position: absolute; left: -10px; top: 22%; bottom: 22%;
  width: 4px; background: var(--c); border-radius: 0 4px 4px 0;
  box-shadow: 0 0 10px var(--c);
}

.gsb-icon {
  width: 38px; height: 38px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-mute); background: rgba(255,255,255,0.02);
  transition: all 0.15s;
}
.gsb-icon svg { width: 22px; height: 22px; }
.gsb-item:hover .gsb-icon,
.gsb-item.active .gsb-icon {
  color: var(--c);
  background: color-mix(in srgb, var(--c) 13%, transparent);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px color-mix(in srgb, var(--c) 25%, transparent);
}

.gsb-label {
  font-size: 14px; font-weight: 700; letter-spacing: 0.3px;
  color: var(--text-mute); text-align: center; white-space: nowrap;
  transition: color 0.15s;
}
.gsb-item:hover .gsb-label,
.gsb-item.active .gsb-label { color: var(--c); }
