/* вынесен из nav.js (SEC-11: style-src без unsafe-inline); подключается ссылкой <link> на страницах и страховочно из скрипта */
/* ═══ DESKTOP TOPBAR ═══════════════════════════════════ */
.nv-topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px;
  padding: 14px 28px;
  background: rgba(13, 10, 24, 0.72);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  position: sticky; top: 0; z-index: 100;
}
.nv-brand {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; user-select: none;
}
.nv-brand-mark {
  width: 28px; height: 28px;
  background: linear-gradient(135deg, #8b5cff, #ff3ec9);
  border-radius: 8px;
  box-shadow: 0 0 16px rgba(139,92,255,0.5);
  flex-shrink: 0;
}
.nv-brand-text {
  font-weight: 900; font-size: 0.92rem;
  letter-spacing: 0.16em;
  color: #fff;
  white-space: nowrap;
}
.nv-tn {
  display: flex; gap: 2px; flex: 1;
  justify-content: center;
}
.nv-tn-link {
  position: relative;
  padding: 9px 14px;
  font-size: 0.86rem; font-weight: 500;
  color: rgba(244,241,255,0.65);
  text-decoration: none;
  border-radius: 10px;
  transition: color 0.15s, background 0.15s;
}
.nv-tn-link:hover {
  color: #fff;
  background: rgba(255,255,255,0.05);
}
.nv-tn-link--active {
  color: #fff;
  background: rgba(139,92,255,0.14);
  box-shadow: inset 0 0 0 1px rgba(139,92,255,0.3);
}
.nv-tn-badge {
  display: inline-flex; align-items: center; justify-content: center;
  margin-left: 6px; padding: 0 6px;
  min-width: 16px; height: 16px;
  font-size: 0.62rem; font-weight: 800;
  background: linear-gradient(135deg, #ff3563, #ff3ec9);
  color: #fff; border-radius: 99px;
}
.nv-tn-account {
  padding: 9px 16px;
  font-size: 0.86rem; font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #8b5cff, #6b3df0);
  border-radius: 10px;
  text-decoration: none;
  box-shadow: 0 4px 16px rgba(139,92,255,0.35);
  transition: transform 0.15s, box-shadow 0.2s;
  white-space: nowrap;
}
.nv-tn-account:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(139,92,255,0.5);
}

/* Контейнер кнопок аккаунта (баланс + кабинет + выйти) */
.nv-tn-userbox {
  display: inline-flex; align-items: center; gap: 8px;
}

/* Бейдж баланса */
.nv-tn-balance {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 13px;
  background: rgba(180,255,57,0.08);
  border: 1px solid rgba(180,255,57,0.3);
  border-radius: 99px;
  color: #b4ff39;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem; font-weight: 700;
  text-decoration: none;
  transition: all 0.2s;
}
.nv-tn-balance:hover {
  background: rgba(180,255,57,0.14);
  border-color: rgba(180,255,57,0.55);
  transform: translateY(-1px);
}

/* Кнопка "Выйти" */
.nv-tn-logout {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(244,241,255,0.05);
  border: 1px solid rgba(167,139,255,0.2);
  color: rgba(244,241,255,0.7);
  cursor: pointer;
  transition: all 0.2s;
}
.nv-tn-logout:hover {
  background: rgba(255,62,201,0.12);
  border-color: rgba(255,62,201,0.5);
  color: #fff;
  transform: translateY(-1px);
}
.nv-tn-logout svg { width: 16px; height: 16px; }

/* ═══ MOBILE TOPBAR ═══════════════════════════════════ */
.nv-mtop {
  display: none;
  align-items: center; justify-content: space-between;
  padding: 12px 16px;
  padding-top: calc(12px + env(safe-area-inset-top, 0));
  background: rgba(13, 10, 24, 0.85);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid rgba(255,255,255,0.05);
  position: sticky; top: 0; z-index: 100;
}
.nv-mtop .nv-brand-text { font-size: 0.84rem; }
.nv-mtop .nv-brand-mark { width: 24px; height: 24px; }
.nv-mtop-avatar {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(139,92,255,0.12);
  border: 1px solid rgba(139,92,255,0.3);
  border-radius: 50%;
  color: #fff;
  text-decoration: none;
  transition: transform 0.15s, background 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.nv-mtop-avatar svg { width: 18px; height: 18px; }
.nv-mtop-avatar:active { transform: scale(0.92); }

/* ═══ BOTTOM NAV — Floating Glass ═════════════════════ */
.nv-bn-wrap {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  padding: 0 12px;
  padding-bottom: calc(12px + env(safe-area-inset-bottom, 0));
  z-index: 100;
  pointer-events: none;
}
.nv-bn {
  position: relative;
  display: flex; align-items: center; justify-content: space-around;
  padding: 6px;
  background: rgba(20, 16, 42, 0.78);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 26px;
  box-shadow:
    0 8px 32px rgba(0,0,0,0.4),
    0 2px 8px rgba(0,0,0,0.3),
    inset 0 1px 0 rgba(255,255,255,0.06);
  pointer-events: auto;
  max-width: 480px;
  margin: 0 auto;
}
.nv-bn-tab {
  flex: 1;
  display: flex; flex-direction: column; align-items: center;
  gap: 2px;
  padding: 8px 4px;
  min-height: 52px;
  color: rgba(244,241,255,0.55);
  text-decoration: none;
  border-radius: 18px;
  position: relative;
  transition: color 0.2s, transform 0.15s, background 0.25s;
  -webkit-tap-highlight-color: transparent;
}
.nv-bn-tab:active { transform: scale(0.94); }
.nv-bn-icon {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  width: 26px; height: 26px;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.nv-bn-icon svg {
  width: 22px; height: 22px;
  stroke-width: 2;
}
.nv-bn-label {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.nv-bn-tab--active {
  color: #fff;
  background: linear-gradient(180deg, rgba(139,92,255,0.22) 0%, rgba(139,92,255,0.06) 100%);
}
.nv-bn-tab--active .nv-bn-icon {
  transform: translateY(-2px);
}
.nv-bn-tab--active .nv-bn-icon svg {
  filter: drop-shadow(0 0 6px rgba(139,92,255,0.7));
  stroke: url(#nv-grad);
  stroke-width: 2.2;
}
.nv-bn-tab--active .nv-bn-label {
  opacity: 1;
  font-weight: 700;
  background: linear-gradient(90deg, #a78bff, #ff3ec9);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}

.nv-bn-badge {
  position: absolute;
  top: -3px; right: -8px;
  min-width: 16px; height: 16px;
  padding: 0 4px;
  font-size: 0.6rem; font-weight: 800;
  background: linear-gradient(135deg, #ff3563, #ff3ec9);
  color: #fff;
  border-radius: 99px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 8px rgba(255,53,99,0.6);
  border: 2px solid rgba(20, 16, 42, 0.9);
  line-height: 1;
}

/* ═══ DRAWER (More) ═══════════════════════════════════ */
.nv-drw-backdrop {
  position: fixed; inset: 0; z-index: 199;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s;
}
.nv-drw-backdrop--open { opacity: 1; pointer-events: auto; }

.nv-drw {
  position: fixed; z-index: 200;
  left: 12px; right: 12px;
  bottom: calc(82px + env(safe-area-inset-bottom, 0));
  max-width: 480px;
  margin: 0 auto;
  background: rgba(20, 16, 42, 0.92);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  border: 1px solid rgba(167,139,255,0.18);
  border-radius: 26px;
  padding: 10px 10px 14px;
  box-shadow:
    0 24px 64px rgba(0,0,0,0.6),
    0 8px 24px rgba(0,0,0,0.4),
    inset 0 1px 0 rgba(255,255,255,0.08);
  opacity: 0;
  transform: translateY(20px) scale(0.96);
  transform-origin: bottom center;
  pointer-events: none;
  transition:
    opacity 0.28s cubic-bezier(0.22, 0.61, 0.36, 1),
    transform 0.32s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.nv-drw--open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.nv-drw-grabber {
  width: 36px; height: 4px;
  background: rgba(255,255,255,0.18);
  border-radius: 99px;
  margin: 4px auto 8px;
}
.nv-drw-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 4px 12px 10px;
}
.nv-drw-title {
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  color: #fff;
}
.nv-drw-close {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 50%;
  color: rgba(244,241,255,0.7);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.nv-drw-close:hover { background: rgba(255,255,255,0.1); color: #fff; }
.nv-drw-close svg { width: 16px; height: 16px; }

.nv-drw-list {
  display: flex; flex-direction: column;
  gap: 2px;
}
.nv-drw-item {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 14px;
  border-radius: 16px;
  color: rgba(244,241,255,0.85);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
  -webkit-tap-highlight-color: transparent;
  min-height: 56px;
}
.nv-drw-item:active { background: rgba(139,92,255,0.18); }
.nv-drw-icon {
  display: flex; align-items: center; justify-content: center;
  width: 38px; height: 38px;
  background: rgba(139,92,255,0.1);
  border: 1px solid rgba(139,92,255,0.18);
  border-radius: 12px;
  color: #a78bff;
  flex-shrink: 0;
}
.nv-drw-icon svg { width: 18px; height: 18px; stroke-width: 2; }
.nv-drw-label {
  flex: 1;
  font-size: 0.94rem;
  font-weight: 600;
  letter-spacing: -0.005em;
}
.nv-drw-chev {
  display: flex; color: rgba(244,241,255,0.3);
}
.nv-drw-chev svg { width: 16px; height: 16px; }

.nv-drw-item--active {
  background: linear-gradient(135deg, rgba(139,92,255,0.2) 0%, rgba(255,62,201,0.08) 100%);
  color: #fff;
}
.nv-drw-item--active .nv-drw-icon {
  background: linear-gradient(135deg, #8b5cff, #ff3ec9);
  color: #fff;
  border-color: transparent;
}
.nv-drw-item--active .nv-drw-chev { color: rgba(244,241,255,0.6); }

/* ═══ RESPONSIVE TOGGLE ═══════════════════════════════ */
@media (max-width: 900px) {
  .nv-topbar { display: none !important; }
  .nv-mtop { display: flex; }
  .nv-bn-wrap { display: block; }
  body { padding-bottom: calc(90px + env(safe-area-inset-bottom, 0)) !important; }
}
@media (min-width: 901px) {
  .nv-mtop, .nv-bn-wrap, .nv-drw, .nv-drw-backdrop {
    display: none !important;
  }
}
/* ═══ LANDSCAPE НА ТЕЛЕФОНЕ — панель компактнее (без подписей), резерв места под неё
     уменьшен пропорционально. Без этого фиксированные 90px "съедали" непропорционально
     много высоты в landscape и панель наезжала на контент страницы над ней. ═══ */
@media (max-width: 900px) and (orientation: landscape) and (max-height: 700px) {
  .nv-bn-wrap { padding-bottom: calc(6px + env(safe-area-inset-bottom, 0)); }
  .nv-bn { padding: 4px; }
  .nv-bn-tab { min-height: 38px; padding: 6px 4px; }
  .nv-bn-label { display: none; }
  .nv-bn-icon { width: 22px; height: 22px; }
  .nv-bn-icon svg { width: 20px; height: 20px; }
  body { padding-bottom: calc(54px + env(safe-area-inset-bottom, 0)) !important; }
}
