/* =========================================================
   Battlox — светлая тема в стиле игровой платформы
   ========================================================= */
:root {
  --bg: #e9ebee;
  --panel: #ffffff;
  --panel-2: #f1f3f5;
  --panel-3: #e6e9ec;
  --border: #dfe3e8;
  --border-2: #c9ced6;
  --line: #dfe3e8;
  --bg-soft: #f1f3f5;
  --text: #1c1e21;
  --text-dim: #6b7280;
  --blue: #2f6bff;
  --blue-dark: #1f54d6;
  --green: #00a651;
  --red: #d7263d;
  --radius: 8px;
  --radius-lg: 12px;
  font-family: "Segoe UI", "Helvetica Neue", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 15px;
}

a { color: inherit; text-decoration: none; }
img { display: block; }

/* ---------- Верхняя панель ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  height: 48px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 16px;
  background: #fff;
  border-bottom: 1px solid var(--border);
}

.topbar__logo { font-weight: 800; font-size: 20px; letter-spacing: -0.02em; }
.topbar__logo span { color: var(--blue); }

.topnav { display: flex; gap: 2px; }
.topnav__link {
  padding: 8px 12px; border-radius: 8px; font-weight: 600;
  color: var(--text-dim); font-size: 14px; white-space: nowrap;
}
.topnav__link:hover { background: var(--panel-2); color: var(--text); }
.topnav__link.is-active { color: var(--text); }

.search { flex: 1; display: flex; justify-content: center; }
.search__box { position: relative; width: 100%; max-width: 460px; }
.search__icon {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: var(--text-dim); font-size: 14px; display: inline-flex;
}
.search__icon svg { width: 16px; height: 16px; display: block; }
.search input {
  width: 100%; padding: 8px 14px 8px 38px; border-radius: 20px;
  background: var(--panel-2); border: 1px solid var(--border);
  outline: none; font-size: 14px; color: var(--text);
}
.search input:focus { background: #fff; border-color: var(--blue); }

.search-results {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0;
  background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: 0 12px 34px rgba(0,0,0,0.18);
  z-index: 40; overflow: hidden; max-height: 70vh; overflow-y: auto;
}
.search-results__group + .search-results__group { border-top: 1px solid var(--border); }
.search-results__title {
  padding: 10px 14px 4px; font-size: 12px; font-weight: 700;
  color: var(--text-dim); text-transform: uppercase; letter-spacing: .04em;
}
.search-results__empty { padding: 18px 14px; text-align: center; color: var(--text-dim); font-size: 13px; }
.sr-row { display: flex; align-items: center; gap: 12px; padding: 8px 14px; cursor: pointer; }
.sr-row:hover { background: var(--panel-2); }
.sr-row__avatar {
  width: 36px; height: 36px; flex: 0 0 36px; border-radius: 50%;
  overflow: hidden; background: var(--panel-3);
}
.sr-row__thumb {
  width: 44px; height: 44px; flex: 0 0 44px; border-radius: 8px;
  overflow: hidden; background: var(--panel-3);
}
.sr-row__avatar img, .sr-row__thumb img { width: 100%; height: 100%; object-fit: cover; }
.sr-row__main { display: flex; flex-direction: column; min-width: 0; }
.sr-row__name {
  font-size: 14px; font-weight: 600; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sr-row__sub { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--text-dim); }
.sr-row__sub svg { width: 13px; height: 13px; flex: 0 0 13px; }

.topbar__right { display: flex; align-items: center; gap: 8px; }

.icon-btn {
  width: 34px; height: 34px; border-radius: 8px; border: none;
  background: transparent; display: grid; place-items: center;
  font-size: 16px; cursor: pointer; color: var(--text-dim);
}
.icon-btn svg { width: 20px; height: 20px; display: block; }
.icon-btn:hover { background: var(--panel-2); color: var(--text); }

/* ---------- Панель уведомлений ---------- */
.notif { position: relative; }
.notif__btn[aria-expanded="true"] { background: var(--panel-2); color: var(--text); }

.notif-panel {
  position: absolute; top: calc(100% + 8px); right: 0;
  width: 380px; max-width: calc(100vw - 24px);
  background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: 0 12px 34px rgba(0,0,0,0.18);
  z-index: 40; overflow: hidden;
}
.notif-panel__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-bottom: 1px solid var(--border);
}
.notif-panel__title { font-size: 16px; font-weight: 700; }
.notif-panel__settings { font-size: 13px; font-weight: 600; color: var(--blue); }
.notif-panel__settings:hover { text-decoration: underline; }

.notif-panel__list { max-height: 460px; overflow-y: auto; }

.notif__item {
  display: flex; gap: 12px; padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.notif__item:last-child { border-bottom: none; }
.notif__item:hover { background: var(--panel-2); }

.notif__thumb {
  flex: none; width: 56px; height: 56px; border-radius: 8px;
  overflow: hidden; background: var(--panel-3);
}
.notif__thumb img { width: 100%; height: 100%; object-fit: cover; }
.notif__thumb--round { border-radius: 50%; }
.notif__thumb--icon {
  display: grid; place-items: center; border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), #6ea8ff); color: #fff;
}
.notif__thumb--icon svg { width: 26px; height: 26px; display: block; }

.notif__main { flex: 1; min-width: 0; }
.notif__row { display: flex; align-items: baseline; gap: 10px; }
.notif__item-title { flex: 1; min-width: 0; font-weight: 700; font-size: 14px; line-height: 1.3; }
.notif__time { flex: none; font-size: 12px; color: var(--text-dim); white-space: nowrap; }
.notif__body { margin-top: 3px; font-size: 13px; color: var(--text-dim); line-height: 1.4; }

.notif__actions { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.notif__act {
  border: none; cursor: pointer; font-family: inherit;
  font-weight: 600; font-size: 13px; padding: 7px 14px; border-radius: 8px;
}
.notif__act--ghost { background: var(--panel-2); color: var(--text); }
.notif__act--ghost:hover { background: var(--panel-3); }
.notif__act--primary { background: var(--blue); color: #fff; }
.notif__act--primary:hover { background: var(--blue-dark); }
.notif__act--dark { background: #2b2f36; color: #fff; }
.notif__act--dark:hover { background: #3a3f48; }
.notif__act--icon {
  margin-left: auto; padding: 6px; border-radius: 50%;
  background: transparent; color: var(--text-dim); display: grid; place-items: center;
}
.notif__act--icon:hover { background: var(--panel-3); color: var(--text); }
.notif__act--icon svg { width: 18px; height: 18px; display: block; }

.user-chip {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 10px 4px 4px; border-radius: 20px; cursor: pointer;
}
.user-chip:hover { background: var(--panel-2); }
.user-chip__avatar {
  width: 30px; height: 30px; border-radius: 50%; overflow: hidden;
  background: linear-gradient(135deg, #2f6bff, #7aa2ff);
  display: grid; place-items: center; color: #fff; font-size: 15px;
}
.user-chip__avatar img { width: 100%; height: 100%; object-fit: cover; }
.user-chip__name { font-weight: 600; font-size: 14px; }

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 16px; border-radius: 8px; font-weight: 600; font-size: 14px;
  cursor: pointer; border: 1px solid transparent;
}
.btn--primary { background: var(--blue); color: #fff; }
.btn--primary:hover { background: var(--blue-dark); }
.btn--ghost { background: transparent; border-color: var(--border-2); color: var(--text); }
.btn--ghost:hover { background: var(--panel-2); }
.btn--block { width: 100%; }
.btn--lg { padding: 12px 32px; font-size: 16px; border-radius: 10px; }
.btn--play {
  width: 100%; padding: 12px 0; border-radius: 10px;
  background: var(--blue); color: #fff;
}
.btn--play:hover { background: var(--blue-dark); }
.play-ic { width: 28px; height: 28px; display: block; }

/* ---------- Общий каркас ---------- */
.shell { display: flex; align-items: flex-start; max-width: 1440px; margin: 0 auto; }

.sidebar {
  width: 232px; flex: 0 0 232px;
  position: sticky; top: 48px;
  height: calc(100vh - 48px); overflow-y: auto;
  padding: 12px 8px 24px;
  border-right: 1px solid var(--border);
}
.sidebar__nav { display: flex; flex-direction: column; gap: 2px; }
.side-item {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 12px; border-radius: 8px;
  color: var(--text); font-size: 14px; font-weight: 500;
}
.side-item:hover { background: var(--panel-2); }
.side-item.is-active { background: var(--panel-3); font-weight: 700; }
.side-item__icon { width: 24px; height: 24px; flex: 0 0 24px; display: inline-flex; align-items: center; justify-content: center; }
.side-item__icon .ic { width: 24px; height: 24px; display: block; stroke-width: 1.5; }
.side-item__badge {
  margin-left: auto; background: #24252b; color: #fff;
  font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 10px;
}
.side-promo {
  margin: 16px 12px 0; padding: 14px; border-radius: 10px;
  background: linear-gradient(135deg, #eef3ff, #e3ecff); border: 1px solid #d6e0f5;
}
.side-promo h4 { font-size: 14px; margin-bottom: 6px; }
.side-promo p { font-size: 12px; color: var(--text-dim); margin-bottom: 10px; }

.content { flex: 1; min-width: 0; padding: 20px 24px 48px; }

/* ---------- Ряд друзей ---------- */
.friends-row { display: flex; gap: 16px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 24px; }
.friend-bubble { flex: 0 0 auto; width: 64px; text-align: center; cursor: pointer; }
.friend-bubble__avatar {
  width: 60px; height: 60px; border-radius: 50%; margin: 0 auto 6px;
  display: grid; place-items: center; font-size: 26px; overflow: hidden;
  background: var(--panel-3); border: 2px solid #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}
.friend-bubble__avatar img { width: 100%; height: 100%; object-fit: cover; }
.friend-bubble__name {
  font-size: 12px; color: var(--text-dim);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.friend-bubble--add .friend-bubble__avatar {
  background: var(--panel-2); border: 1px dashed var(--border-2);
  box-shadow: none; color: var(--blue);
}
.friend-bubble__plus { font-size: 28px; font-weight: 700; line-height: 1; }
.friend-bubble--add .friend-bubble__name { color: var(--blue); font-weight: 600; }

/* ---------- Секции ---------- */
.section { margin-bottom: 32px; }
.section__head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 14px; }
.section__title { font-size: 20px; font-weight: 700; }
.section__count { color: var(--text-dim); font-weight: 600; }
.section__more { color: var(--blue); font-weight: 600; font-size: 14px; }

.page-title { font-size: 26px; font-weight: 800; margin-bottom: 20px; }

.continue-row { display: flex; justify-content: flex-end; margin-top: 8px; }

/* ---------- Карточки игр ---------- */
.grid--games { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; }

.game-card { cursor: pointer; }
.game-card__thumb {
  position: relative; aspect-ratio: 16 / 9; border-radius: 8px;
  overflow: hidden; display: grid; place-items: center;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
}
.game-card__img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; z-index: 1;
}
.game-card__title { margin-top: 8px; font-weight: 700; font-size: 14px; line-height: 1.25; }
.game-card__rating {
  display: flex; align-items: center; gap: 6px; margin-top: 4px;
  font-size: 13px; color: var(--text-dim);
}
.game-card__thumb-up { font-size: 13px; display: inline-flex; }
.game-card__thumb-up svg { width: 14px; height: 14px; display: block; }
.game-card__pct { font-weight: 700; color: var(--text); }
.game-card__rating-label { color: var(--text-dim); }

/* ---------- Профиль ---------- */
.profile-banner {
  height: 300px; border-radius: var(--radius-lg); overflow: hidden;
  background: linear-gradient(180deg, #d5d7de 0%, #b2b6c4 100%);
  position: relative;
}
.profile-banner__fig {
  position: absolute; left: 50%; top: 30px; transform: translateX(-50%);
  height: 216px;
  filter: drop-shadow(0 8px 16px rgba(40, 55, 75, 0.16));
}
.profile-banner__view { position: absolute; inset: 0; cursor: grab; touch-action: none; }
.profile-banner__view:active { cursor: grabbing; }
.profile-banner__view canvas { display: block; width: 100% !important; height: 100% !important; }
.profile-head {
  position: relative; display: flex; align-items: center; gap: 16px;
  padding: 0 24px; margin-top: -21px;
}
.profile-head__avatar {
  width: 128px; height: 128px; border-radius: 50%; border: 4px solid #fff;
  display: grid; place-items: center; font-size: 56px; overflow: hidden;
  background: var(--panel-3); flex: none;
}
.profile-head__avatar img { width: 100%; height: 100%; object-fit: cover; object-position: center top; }
.profile-head__avatar canvas { width: 100%; height: 100%; display: block; }
.profile-head__meta { flex: 1; }
.profile-head__name { font-size: 26px; font-weight: 800; }
.profile-head__handle { color: var(--text-dim); font-size: 14px; }
.profile-actions { display: flex; gap: 10px; }
.btn.is-subscribed { background: transparent; border-color: var(--border); color: var(--text); }

.pills { display: flex; gap: 10px; margin: 20px 0; }
.pill {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 16px; border-radius: 8px; background: var(--panel);
  border: 1px solid var(--border); font-weight: 600; font-size: 14px; cursor: pointer;
}
.pill.is-active { border-color: var(--blue); color: var(--blue); }
.pill__num { color: var(--text-dim); font-weight: 600; }

.bio { color: var(--text-dim); font-size: 14px; margin-bottom: 20px; max-width: 640px; }

.tabs { display: flex; border-bottom: 1px solid var(--border); margin-bottom: 20px; }
.tab {
  flex: 1; text-align: center; padding: 12px 16px; font-weight: 600; color: var(--text-dim);
  cursor: pointer; border-bottom: 2px solid transparent; font-size: 15px;
}
.tab.is-active { color: var(--text); border-bottom-color: var(--text); }

button.tab { background: none; border-top: 0; border-left: 0; border-right: 0; font-family: inherit; }
button.tab:hover { color: var(--text); }

.tab-panel { display: none; }
.tab-panel.is-active { display: block; }
.soon {
  display: grid; place-items: center; min-height: 200px; margin: 0;
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-lg);
  color: var(--text-dim); font-size: 15px; font-weight: 600;
}

.wearing-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 14px; }
.wear { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 14px; text-align: center; }
.wear__thumb {
  aspect-ratio: 1; border-radius: 8px; overflow: hidden;
  background: var(--panel-2); margin-bottom: 8px;
}
.wear__thumb img { width: 100%; height: 100%; object-fit: cover; }
.wear__name { font-size: 13px; font-weight: 600; }

/* ---------- Страница игры ---------- */
.game-hero { display: flex; gap: 24px; margin-bottom: 24px; }
.game-hero__thumb {
  position: relative; flex: 1; max-width: 780px; aspect-ratio: 16 / 9; border-radius: 12px;
  overflow: hidden; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}
.game-hero__img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
}
.game-side { width: 400px; flex: 0 0 400px; }
.game-side__title { font-size: 24px; font-weight: 800; line-height: 1.2; }
.game-side__by { color: var(--text-dim); font-size: 13px; margin-top: 6px; }
.game-side__maturity { color: var(--text-dim); font-size: 13px; margin-top: 2px; }
.game-actions { display: flex; gap: 8px; margin-top: 16px; }
.game-meta-row { display: flex; align-items: flex-start; gap: 24px; margin-top: 16px; }
.meta-btn {
  display: inline-flex; flex-direction: column; align-items: center; gap: 6px;
  background: none; border: none; padding: 0; cursor: pointer;
  font-size: 12px; font-weight: 500; color: var(--text-dim);
}
.meta-btn:hover { color: var(--text); }
.meta-btn__icon { display: inline-flex; color: var(--text); }
.meta-btn__icon svg { width: 22px; height: 22px; display: block; }
.meta-btn__label { line-height: 1; }
.vote { display: flex; align-items: flex-start; }
.vote__btn {
  display: inline-flex; flex-direction: column; align-items: center; gap: 6px;
  background: none; border: none; padding: 0 16px; cursor: pointer;
  font-size: 12px; font-weight: 500; color: var(--text-dim);
}
.vote__btn:first-child { border-right: 1px dashed var(--border); }
.vote__btn:hover { color: var(--text); }
.vote__icon { display: inline-flex; color: var(--text); }
.vote__icon svg { width: 22px; height: 22px; display: block; }
.vote__count { line-height: 1; }

.stats-list {
  list-style: none; margin: 20px 0 0; padding: 12px 0;
  border-top: 1px solid var(--border-2); border-bottom: 1px solid var(--border-2);
  display: flex; flex-wrap: nowrap;
}
.stat { flex: 1 0 0; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.stat__label { color: #494d5a; font-size: 12px; font-weight: 500; white-space: nowrap; }
.stat__value { font-weight: 400; font-size: 12px; color: #202227; }

.report-row { display: flex; justify-content: flex-end; margin-top: 12px; }
.report-link { color: var(--red); font-size: 13px; font-weight: 600; }
.report-link:hover { text-decoration: underline; }

/* ---------- Вход ---------- */
.login-wrap {
  max-width: 420px; margin: 60px auto; padding: 32px; background: var(--panel);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
}
.login-wrap h1 { font-size: 22px; margin-bottom: 8px; }
.login-wrap p { color: var(--text-dim); margin-bottom: 24px; font-size: 14px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; margin-bottom: 6px; color: var(--text-dim); font-weight: 600; }
.field input {
  width: 100%; padding: 11px 14px; border-radius: 8px;
  background: var(--panel-2); border: 1px solid var(--border); outline: none;
  font-size: 14px; color: var(--text);
}
.field input:focus { background: #fff; border-color: var(--blue); }
.login-note { font-size: 13px; color: var(--text-dim); margin-top: 16px; text-align: center; }
.login-note a { color: var(--blue); font-weight: 600; }

.footer { text-align: center; color: var(--text-dim); padding: 28px; font-size: 13px; }
.footer__credit { margin-top: 6px; font-size: 12px; color: var(--text-dim); opacity: 0.85; }

/* ---------- Редактор аватара ---------- */
.avatar-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
}
.avatar-head .page-title { margin-bottom: 20px; }
.avatar-head__more { color: var(--blue); font-weight: 600; font-size: 14px; margin-bottom: 20px; }

.avatar-editor {
  display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 24px;
  align-items: start;
}

.avatar-stage {
  position: relative; border-radius: var(--radius-lg); overflow: hidden;
  background: radial-gradient(120% 90% at 50% 12%, #f4f6fa 0%, #dfe4ec 62%, #cfd6e2 100%);
  border: 1px solid var(--border);
  aspect-ratio: 4 / 5; max-height: 480px;
  cursor: grab; touch-action: none; user-select: none;
}
.avatar-stage:active { cursor: grabbing; }
.avatar-stage__canvas { position: absolute; inset: 0; cursor: grab; }
.avatar-stage__canvas:active { cursor: grabbing; }
.avatar-stage__canvas canvas { display: block; width: 100% !important; height: 100% !important; }

.avatar-side {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 18px;
}
.avatar-group { margin-bottom: 20px; }
.avatar-group:last-child { margin-bottom: 0; }
.avatar-group__title { font-size: 14px; font-weight: 700; margin-bottom: 10px; }

.swatch-row { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch {
  width: 34px; height: 34px; border-radius: 8px; cursor: pointer;
  border: 2px solid var(--border-2); padding: 0;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
  transition: transform 0.08s ease;
}
.swatch:hover { transform: translateY(-1px); }
.swatch.is-active { border-color: var(--blue); box-shadow: 0 0 0 2px rgba(47, 107, 255, 0.25); }
.swatch--add {
  display: grid; place-items: center; background: var(--panel-2);
  border: 2px dashed var(--border-2); color: var(--text-dim);
}
.swatch--add:hover { color: var(--blue); border-color: var(--blue); background: #fff; }
.swatch--add svg { width: 18px; height: 18px; display: block; }

/* ---------- Палитра ---------- */
.palette {
  position: fixed; z-index: 60; width: 268px; padding: 14px;
  background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: 0 14px 40px rgba(0, 0, 0, 0.22);
}
.palette__grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.palette__cell {
  aspect-ratio: 1; border-radius: 6px; cursor: pointer; padding: 0;
  border: 2px solid var(--border);
}
.palette__cell:hover { transform: scale(1.06); }
.palette__cell.is-active { border-color: var(--blue); box-shadow: 0 0 0 2px rgba(47, 107, 255, 0.3); }
.palette__custom {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-top: 12px; font-size: 13px; font-weight: 600; color: var(--text-dim);
}
.palette__custom input[type="color"] {
  width: 44px; height: 30px; padding: 0; border: 1px solid var(--border-2);
  border-radius: 6px; background: none; cursor: pointer;
}
.palette__actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }

/* ---------- Меню сваджа ---------- */
.swatch-menu {
  position: fixed; z-index: 60;
  background: #fff; border: 1px solid var(--border);
  border-radius: 10px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  padding: 4px; min-width: 148px;
}
.swatch-menu button {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 9px 12px; border: none; border-radius: 7px; cursor: pointer;
  background: transparent; color: var(--red); font-family: inherit;
  font-size: 14px; font-weight: 600; text-align: left;
}
.swatch-menu button:hover { background: #fdecee; }
.swatch-menu svg { width: 17px; height: 17px; display: block; }

/* ---------- Вход / гейт авторизации ---------- */
.login-error {
  background: #fdecee; border: 1px solid #f4c2c8; color: var(--red);
  border-radius: 8px; padding: 10px 12px; font-size: 14px; margin-bottom: 16px;
}

.auth-gate {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  background: rgba(18, 20, 24, 0.55); padding: 20px;
}
.auth-gate[hidden] { display: none; }
.auth-gate__box {
  width: 100%; max-width: 360px; background: var(--panel);
  border-radius: 14px; padding: 24px 22px; text-align: center;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}
.auth-gate__title { font-size: 20px; margin-bottom: 8px; }
.auth-gate__text { color: var(--text-dim); font-size: 14px; margin-bottom: 20px; }
.auth-gate__actions { display: flex; flex-direction: column; gap: 10px; }

/* ---------- Онбординг ---------- */
.onb-body { background: var(--bg); }
.onb {
  max-width: 640px; margin: 0 auto; padding: 32px 20px 64px;
}
.onb__brand { text-align: center; font-size: 26px; font-weight: 800; margin-bottom: 22px; }
.onb__brand span { color: var(--blue); }
.onb__card {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 14px; padding: 28px 26px;
}
.onb__card--wide { max-width: 900px; }
.onb__title { font-size: 22px; margin-bottom: 6px; }
.onb__subtitle { color: var(--text-dim); font-size: 14px; margin-bottom: 20px; }
.onb__preview {
  position: relative; margin-bottom: 22px; border-radius: 12px;
  overflow: hidden; background: linear-gradient(135deg, #2f6bff, #1f54d6);
  height: 200px;
}
.onb__banner { position: absolute; inset: 0; }
.onb__avatar {
  position: absolute; left: 20px; bottom: -34px; width: 96px; height: 96px;
  border-radius: 50%; background: var(--panel); border: 4px solid var(--panel);
  overflow: hidden; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
}
.onb__hint { color: var(--text-dim); font-size: 12px; margin-top: 4px; }
.onb__error { color: var(--red); font-size: 13px; margin-top: 10px; }
.onb__actions { display: flex; flex-direction: column; gap: 10px; margin-top: 20px; }
.onb__actions--row { flex-direction: row; justify-content: flex-end; }
.onb__actions--row .btn { width: auto; }

@media (max-width: 700px) {
  .onb__card { padding: 22px 16px; }
}

/* Формы входа и регистрации */
.login-form { display: flex; flex-direction: column; gap: 14px; margin-bottom: 20px; }
.login-form .field { display: flex; flex-direction: column; gap: 6px; }
.login-form label { font-size: 13px; color: var(--text-dim); }
.login-form input { width: 100%; padding: 11px 12px; border-radius: 10px; border: 1px solid var(--line, #2a333d); background: var(--bg-soft, #0f1317); color: inherit; font-size: 15px; }
.login-form input:focus { outline: none; border-color: var(--blue, #3b82f6); }
.login-form input[readonly] { opacity: .7; }

/* Пустые состояния */
.empty-note { grid-column: 1 / -1; color: var(--text-dim); font-size: 14px; }

/* =========================================================
   Тёмная тема
   ========================================================= */
:root[data-theme="dark"] {
  --bg: #0e1116;
  --panel: #171b22;
  --panel-2: #1f242d;
  --panel-3: #272e39;
  --border: #2a313c;
  --border-2: #3a4453;
  --line: #2a313c;
  --bg-soft: #1f242d;
  --text: #e7eaf0;
  --text-dim: #9aa4b2;
  --blue: #3b82ff;
  --blue-dark: #2f6bff;
  --green: #22c55e;
  --red: #ef5350;
}
:root[data-theme="dark"] .topbar { background: var(--panel); }
:root[data-theme="dark"] .search input:focus { background: var(--panel-2); }
:root[data-theme="dark"] .search-results,
:root[data-theme="dark"] .notif-panel { background: var(--panel); }
:root[data-theme="dark"] .field input:focus { background: var(--panel-2); }
:root[data-theme="dark"] .swatch--add:hover { background: var(--panel-2); }
:root[data-theme="dark"] .palette,
:root[data-theme="dark"] .swatch-menu { background: var(--panel); }
:root[data-theme="dark"] .swatch-menu button:hover { background: rgba(239, 83, 80, 0.12); }
:root[data-theme="dark"] .login-error { background: rgba(239, 83, 80, 0.12); border-color: rgba(239, 83, 80, 0.35); }
:root[data-theme="dark"] .friend-bubble__avatar { border-color: var(--panel); }
:root[data-theme="dark"] .profile-head__avatar { border-color: var(--panel); }
:root[data-theme="dark"] .profile-banner { background: linear-gradient(180deg, #2b3444 0%, #1c232e 100%); }
:root[data-theme="dark"] .side-promo { background: linear-gradient(135deg, #1b2333, #172030); border-color: #24304a; }
:root[data-theme="dark"] .side-item__badge { background: #3a4453; }
:root[data-theme="dark"] .stat__label { color: var(--text-dim); }
:root[data-theme="dark"] .stat__value { color: var(--text); }
:root[data-theme="dark"] .avatar-stage { background: radial-gradient(120% 90% at 50% 12%, #2a3342 0%, #1b212b 62%, #141922 100%); }

/* =========================================================
   Настройки
   ========================================================= */
.settings-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 24px; align-items: start; }
.settings-nav { position: sticky; top: 68px; display: flex; flex-direction: column; gap: 2px; }
.settings-nav__item {
  display: block; padding: 9px 12px; border-radius: 8px; font-size: 14px;
  font-weight: 600; color: var(--text-dim); cursor: pointer;
}
.settings-nav__item:hover { background: var(--panel-2); color: var(--text); }
.settings-nav__item.is-active { background: var(--panel-3); color: var(--text); }

.settings-card {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 22px 24px;
}
.settings-card + .settings-card { margin-top: 20px; }
.settings-card__title { font-size: 18px; font-weight: 700; margin-bottom: 4px; }
.settings-card__sub { color: var(--text-dim); font-size: 13px; margin-bottom: 18px; }
.settings-field { max-width: 420px; margin-bottom: 16px; }
.settings-field:last-child { margin-bottom: 0; }
.form-note { font-size: 12px; color: var(--text-dim); margin-top: 6px; }
.form-ok { color: var(--green); font-size: 13px; margin-top: 12px; }
.form-err { color: var(--red); font-size: 13px; margin-top: 12px; }
.form-err[hidden], .form-ok[hidden] { display: none; }
.settings-actions { display: flex; align-items: center; gap: 12px; margin-top: 6px; }

.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.seg__btn {
  padding: 9px 18px; background: var(--panel-2); border: none; cursor: pointer;
  font-family: inherit; font-weight: 600; font-size: 14px; color: var(--text-dim);
}
.seg__btn + .seg__btn { border-left: 1px solid var(--border); }
.seg__btn.is-active { background: var(--blue); color: #fff; }

/* =========================================================
   Друзья
   ========================================================= */
.friends-tabs { display: flex; gap: 4px; margin-bottom: 20px; border-bottom: 1px solid var(--border); }
.ftab {
  padding: 10px 16px; font-weight: 600; font-size: 15px; color: var(--text-dim);
  cursor: pointer; border-bottom: 2px solid transparent;
  background: none; border-top: 0; border-left: 0; border-right: 0; font-family: inherit;
}
.ftab:hover { color: var(--text); }
.ftab.is-active { color: var(--text); border-bottom-color: var(--text); }
.ftab__count {
  display: inline-block; margin-left: 6px; background: var(--blue); color: #fff;
  font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 10px; vertical-align: middle;
}
.ftab__count[hidden] { display: none; }

.user-list { display: flex; flex-direction: column; gap: 10px; }
.user-card {
  display: flex; align-items: center; gap: 14px; padding: 12px 14px;
  background: var(--panel); border: 1px solid var(--border); border-radius: 12px;
}
.user-card__avatar {
  width: 52px; height: 52px; flex: none; border-radius: 50%; overflow: hidden;
  background: var(--panel-3);
}
.user-card__avatar img { width: 100%; height: 100%; object-fit: cover; }
.user-card__main { flex: 1; min-width: 0; }
.user-card__name { font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-card__handle { color: var(--text-dim); font-size: 13px; }
.user-card__actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.btn--sm { padding: 7px 14px; font-size: 13px; border-radius: 8px; }
.btn--danger { background: transparent; border-color: var(--border-2); color: var(--red); }
.btn--danger:hover { background: rgba(215, 38, 61, 0.1); }
.friends-empty { color: var(--text-dim); font-size: 14px; padding: 8px 0; }
.friends-search { display: flex; gap: 10px; margin-bottom: 18px; }
.friends-search input {
  flex: 1; padding: 11px 14px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--panel-2); color: var(--text); outline: none; font-size: 14px;
}
.friends-search input:focus { border-color: var(--blue); }

@media (max-width: 800px) {
  .settings-layout { grid-template-columns: 1fr; }
  .settings-nav { position: static; flex-direction: row; flex-wrap: wrap; }
}

