/* БЕСПЛОТНИКИ — тёмная тема «вечность» */
:root {
  --bg: #050507;
  --bg-soft: #0c0c12;
  --line: rgba(255, 255, 255, 0.08);
  --text: #e8e8ef;
  --muted: #8a8a99;
  --accent: #4f7cff;
  --accent-soft: rgba(79, 124, 255, 0.15);
  --font-display: 'Unbounded', sans-serif;
  --font-body: 'Inter', sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

/* фоновый холст растений шире колонки контента (100vw) — гасим боковую прокрутку */
html { overflow-x: hidden; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* Фоновая дымка */
.veil {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(600px 400px at 20% -10%, rgba(79, 124, 255, 0.10), transparent 70%),
    radial-gradient(800px 500px at 90% 110%, rgba(120, 79, 255, 0.07), transparent 70%);
  z-index: 0;
}

main { flex: 1; position: relative; z-index: 1; width: 100%; max-width: 1100px; margin: 0 auto; padding: 0 24px; }

a { color: var(--text); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--accent); }
h1, h2, h3 { font-family: var(--font-display); font-weight: 500; line-height: 1.2; }
.muted { color: var(--muted); }

/* Шапка */
.site-header {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 32px;
  padding: 20px 32px;
  border-bottom: 1px solid var(--line);
}
.logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.22em;
}
.main-nav { display: flex; gap: 24px; flex: 1; }
.main-nav a, .auth-nav a { font-size: 14px; color: var(--muted); }
.main-nav a:hover, .auth-nav a:hover { color: var(--text); }
.auth-nav { display: flex; align-items: center; gap: 18px; }
.user-link { color: var(--accent) !important; }
.link-btn {
  background: none; border: none; cursor: pointer;
  color: var(--muted); font: 14px var(--font-body);
}
.link-btn:hover { color: var(--text); }

/* Кнопки */
.btn {
  display: inline-block;
  background: var(--accent);
  color: #fff !important;
  border: 1px solid var(--accent);
  border-radius: 4px;
  padding: 12px 28px;
  font: 600 14px var(--font-body);
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: box-shadow 0.25s, transform 0.15s, background 0.2s;
}
.btn:hover { box-shadow: 0 0 24px rgba(79, 124, 255, 0.45); transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--text) !important; border-color: var(--line); }
.btn-ghost:hover { border-color: var(--accent); box-shadow: 0 0 18px rgba(79, 124, 255, 0.25); }
.btn-sm { padding: 8px 18px; font-size: 13px; }
.btn-wide { width: 100%; }

/* Флэш-сообщения */
.flash {
  position: relative; z-index: 2;
  max-width: 640px; margin: 16px auto 0; padding: 12px 20px;
  border-radius: 4px; font-size: 14px; text-align: center;
}
.flash-error { background: rgba(255, 80, 80, 0.12); border: 1px solid rgba(255, 80, 80, 0.35); color: #ffb0b0; }
.flash-ok { background: var(--accent-soft); border: 1px solid rgba(79, 124, 255, 0.4); color: #b9cbff; }

/* Герой */
.hero { position: relative; text-align: center; padding: 60px 0 20px; }
.hero-inner { position: relative; z-index: 1; }

/* Девиз клуба — редактируется в админке */
.motto {
  max-width: 720px;
  margin: 0 auto;
  padding: 50px 0 10px;
  text-align: center;
}
.motto p {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: 26px;
  line-height: 1.45;
  color: var(--text);
}

/* Сцена превращения: человек — дерево — шар.
   Живой фон всего экрана: зафиксирован, не прокручивается, не ловит клики
   и лежит под контентом — текст и элементы он не задевает. */
.stage-bg {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
  opacity: 0.55;
  /* кверху линии растворяются, чтобы не спорить с заголовками */
  -webkit-mask-image: linear-gradient(to top, #000 28%, rgba(0,0,0,0.30) 72%, transparent 96%);
  mask-image: linear-gradient(to top, #000 28%, rgba(0,0,0,0.30) 72%, transparent 96%);
}
#particles { width: 100%; max-width: 900px; height: 220px; display: block; margin: 0 auto; }
.hero-sub { color: var(--muted); font-size: 18px; margin-top: 4px; }
.hero-actions { display: flex; gap: 16px; justify-content: center; margin-top: 32px; }

@media (max-width: 720px) {
  .hero { padding-top: 40px; }
  .motto { padding-top: 34px; }
  .motto p { font-size: 20px; }
  /* на узком экране текст занимает всю высоту — фон приглушаем сильнее */
  .stage-bg { opacity: 0.36; }
}

/* Статические/CMS-страницы */
.page { padding: 60px 0 80px; max-width: 760px; margin: 0 auto; }
.page h1 { font-size: 32px; margin-bottom: 24px; }
.page-content p { margin-bottom: 16px; }
.page-content h2 { font-size: 22px; margin: 32px 0 12px; }
.centered { text-align: center; }
.glyph { font-size: 72px; color: var(--accent); margin-bottom: 8px; }
.centered .btn-ghost { margin-top: 24px; }

/* Формы аутентификации */
.auth-card {
  max-width: 420px;
  margin: 60px auto 100px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 40px;
}
.auth-card h1 { font-size: 22px; margin-bottom: 8px; }
.auth-card form { margin-top: 24px; display: flex; flex-direction: column; gap: 18px; }
.auth-card label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--muted); }
.auth-card small { color: var(--muted); font-size: 12px; }
.auth-card input {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--text);
  padding: 12px 14px;
  font: 15px var(--font-body);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.auth-card input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.auth-links { display: flex; justify-content: space-between; margin-top: 20px; font-size: 13px; }
.auth-links a { color: var(--muted); }

/* Личный кабинет */
.account { padding: 60px 0 100px; }
.account-card {
  display: flex; gap: 32px; align-items: center;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 32px;
}
.avatar-block { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.avatar {
  width: 112px; height: 112px; border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--accent);
  box-shadow: 0 0 30px rgba(79, 124, 255, 0.35);
}
.avatar-empty {
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-size: 40px; color: var(--accent);
  background: var(--accent-soft);
}
.account-info h1 { font-size: 24px; }
.account-dates { font-size: 13px; margin-top: 10px; }
.account-modules {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px; margin-top: 20px;
}
.module { background: var(--bg-soft); border: 1px solid var(--line); border-radius: 6px; padding: 24px; }
.module h3 { font-size: 16px; margin-bottom: 6px; }
.module p { font-size: 13px; }

/* Админка */
.admin { padding: 60px 0 100px; }
.admin h1 { font-size: 28px; margin-bottom: 32px; }
.admin h2 { font-size: 18px; margin: 48px 0 8px; }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px; }
.stat {
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: 6px;
  padding: 20px; display: flex; flex-direction: column; gap: 4px;
}
.stat-value { font-family: var(--font-display); font-size: 28px; color: var(--accent); }
.stat-label { font-size: 13px; color: var(--muted); }

/* Подвал */
.site-footer {
  position: relative; z-index: 1;
  border-top: 1px solid var(--line);
  padding: 28px 32px;
  display: flex; justify-content: space-between; align-items: center; gap: 20px;
  flex-wrap: wrap;
}
.site-footer nav { display: flex; gap: 20px; }
.site-footer a { font-size: 13px; color: var(--muted); }
.site-footer .copy { font-size: 13px; color: var(--muted); }

/* Навигация админки */
.admin-nav {
  display: flex; align-items: center; gap: 4px;
  border: 1px solid var(--line); border-radius: 6px;
  padding: 6px; margin-bottom: 32px;
  background: var(--bg-soft);
  flex-wrap: wrap;
}
.admin-nav a {
  padding: 8px 16px; border-radius: 4px;
  font-size: 14px; color: var(--muted);
}
.admin-nav a:hover { color: var(--text); }
.admin-nav a.active { background: var(--accent-soft); color: var(--accent); }
.admin-nav-soon { margin-left: auto; font-size: 12px; padding-right: 10px; }
.quick-actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
/* График посещений */
.chart {
  display: flex; align-items: flex-end; gap: 6px;
  height: 240px; padding: 16px 8px 0;
  background: var(--bg-soft); border: 1px solid var(--line);
  border-radius: 6px; margin-bottom: 32px; overflow-x: auto;
}
.chart-col { flex: 1 1 0; min-width: 22px; display: flex; flex-direction: column; align-items: center; height: 100%; }
.chart-bars { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 3px; }
.chart .bar { width: 40%; min-height: 1px; border-radius: 2px 2px 0 0; transition: height .3s; }
.bar-visitors { background: var(--accent); }
.bar-views { background: rgba(120, 79, 255, 0.45); }
.chart-col:hover .bar-visitors { background: #7ea0ff; }
.chart-label { font-size: 11px; color: var(--muted); margin-top: 8px; white-space: nowrap; }
.stats-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.stats-cols h2 { font-size: 16px; margin-bottom: 12px; }
@media (max-width: 720px) { .stats-cols { grid-template-columns: 1fr; } }

.admin-form textarea.mono { font: 13px/1.55 ui-monospace, Consolas, "Courier New", monospace; }
.placeholders {
  background: var(--bg-soft); border: 1px solid var(--line);
  border-radius: 6px; padding: 18px 22px;
}
.placeholders h3 { font-size: 14px; margin-bottom: 6px; }
.placeholders ul { margin: 10px 0 0 18px; font-size: 13px; color: var(--muted); }
.placeholders li { margin-bottom: 5px; }
.placeholders code { background: var(--bg); border: 1px solid var(--line); border-radius: 3px; padding: 1px 6px; color: var(--accent); }
.reset-form { margin-top: 26px; }
.filter-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.filter {
  font-size: 13px; color: var(--muted);
  border: 1px solid var(--line); border-radius: 20px; padding: 6px 14px;
}
.filter:hover { color: var(--text); border-color: rgba(79, 124, 255, 0.4); }
.filter.active { background: var(--accent-soft); border-color: rgba(79, 124, 255, 0.5); color: var(--accent); }
.export-btn { margin-left: auto; }
.attention-list { display: flex; flex-direction: column; gap: 8px; max-width: 520px; }
.attention-row {
  display: flex; justify-content: space-between; align-items: center;
  background: var(--bg-soft); border: 1px solid var(--line);
  border-radius: 6px; padding: 14px 18px; font-size: 14px;
}
.attention-row:hover { border-color: rgba(79, 124, 255, 0.5); color: var(--text); }
.attention-hot { border-color: rgba(79, 124, 255, 0.45); }

/* Формы админки */
.admin-form { display: flex; flex-direction: column; gap: 18px; max-width: 760px; }
.admin-form label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--muted); }
.admin-form input, .admin-form textarea, .admin-form select {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--text);
  padding: 11px 14px;
  font: 15px var(--font-body);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.admin-form input:focus, .admin-form textarea:focus, .admin-form select:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}
.admin-form textarea { resize: vertical; }
.admin-form small { font-size: 12px; }
.admin-form .checkbox { flex-direction: row; align-items: center; gap: 10px; color: var(--text); }
.admin-form .checkbox input { width: 16px; height: 16px; accent-color: var(--accent); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-actions { display: flex; gap: 12px; }
.admin-form button[type="submit"] { align-self: flex-start; }

/* Таблицы админки */
.admin-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.admin-table th {
  text-align: left; padding: 10px 14px;
  color: var(--muted); font-weight: 500; font-size: 12px;
  text-transform: uppercase; letter-spacing: 0.08em;
  border-bottom: 1px solid var(--line);
}
.admin-table td { padding: 12px 14px; border-bottom: 1px solid var(--line); }
.row-actions { display: flex; gap: 8px; align-items: center; }
.row-actions form { display: inline; }
.btn-danger { color: #ff8080 !important; }
.btn-danger:hover { border-color: rgba(255, 80, 80, 0.5); box-shadow: 0 0 14px rgba(255, 80, 80, 0.2); }
.tag {
  font-size: 12px; padding: 3px 10px; border-radius: 20px;
  background: var(--bg-soft); border: 1px solid var(--line); color: var(--muted);
}
.tag-ok { background: var(--accent-soft); border-color: rgba(79, 124, 255, 0.4); color: #b9cbff; }

/* Конструктор меню */
.menu-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 40px; }
.menu-col { background: var(--bg-soft); border: 1px solid var(--line); border-radius: 6px; padding: 20px; }
.menu-col h2 { font-size: 15px; margin-bottom: 16px; }
.menu-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 4px;
  margin-bottom: 8px; background: var(--bg);
}
.menu-label { display: flex; flex-direction: column; font-size: 14px; }
.menu-label small { font-size: 12px; }
.menu-actions { display: flex; gap: 4px; }
.menu-actions form { display: inline; }
.icon-btn {
  background: none; border: 1px solid var(--line); border-radius: 4px;
  color: var(--muted); cursor: pointer; padding: 4px 9px; font-size: 13px;
  transition: color 0.2s, border-color 0.2s;
}
.icon-btn:hover { color: var(--accent); border-color: var(--accent); }
.icon-danger:hover { color: #ff8080; border-color: rgba(255, 80, 80, 0.5); }

/* Магазин */
.shop { padding: 60px 0 100px; }
.shop h1 { font-size: 28px; margin-bottom: 32px; }
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 20px; }
.shop-card {
  display: block; background: var(--bg-soft);
  border: 1px solid var(--line); border-radius: 6px;
  padding: 16px; transition: border-color 0.25s, transform 0.25s, box-shadow 0.25s;
}
.shop-card:hover {
  border-color: rgba(79, 124, 255, 0.5); transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5); color: var(--text);
}
.shop-img {
  aspect-ratio: 4 / 3; border-radius: 4px; overflow: hidden;
  background: var(--bg); display: flex; align-items: center; justify-content: center;
  margin-bottom: 14px;
}
.shop-img img { width: 100%; height: 100%; object-fit: cover; }
.shop-img-empty { font-family: var(--font-display); font-size: 48px; color: var(--accent); opacity: 0.4; }
.shop-card h2 { font-size: 16px; margin-bottom: 8px; }
.shop-meta { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; }
.price { font-family: var(--font-display); color: var(--accent); font-size: 16px; }
.price-lg { font-size: 26px; margin: 8px 0 4px; }

.shop-item { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; padding: 60px 0 100px; }
.shop-item-media img { width: 100%; border-radius: 6px; border: 1px solid var(--line); }
.shop-img-tall { aspect-ratio: 4 / 3; }
.shop-item-info h1 { font-size: 28px; }
.buy-form { display: flex; gap: 12px; margin-top: 24px; }
.qty-input {
  width: 74px; background: var(--bg-soft); border: 1px solid var(--line);
  border-radius: 4px; color: var(--text); padding: 10px 12px; font: 15px var(--font-body);
}
.small-note { font-size: 13px; margin-top: 12px; }
.cart-link { color: var(--accent) !important; }
.cart-table input { text-align: center; }
.cart-total td { font-size: 16px; border-bottom: none; }
.checkout-block { margin-top: 32px; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.requisites { margin-top: 32px; }
.requisites h2 { font-size: 18px; margin-bottom: 12px; }
.requisites-text {
  background: var(--bg-soft); border: 1px solid rgba(79, 124, 255, 0.4);
  border-radius: 6px; padding: 18px 22px; white-space: pre-wrap;
  font: 14px var(--font-body); color: #b9cbff;
}
.item-thumb { width: 180px; border-radius: 4px; border: 1px solid var(--line); margin: 6px 0; }
.module-wide { grid-column: 1 / -1; }
.shop-intro { max-width: 640px; margin: -20px 0 28px; font-size: 14px; }
.resident-gate {
  margin-top: 24px;
  background: var(--accent-soft);
  border: 1px solid rgba(79, 124, 255, 0.4);
  border-radius: 6px;
  padding: 20px 24px;
}
.resident-gate p { font-size: 14px; margin-bottom: 14px; }
.gate-actions { justify-content: flex-start; margin-top: 0; }

/* Аукцион */
.section-h { font-size: 18px; margin: 40px 0 16px; }
.lot-timer { margin-top: 10px; font-size: 14px; }
.lot-timer strong { font-family: var(--font-display); color: var(--accent); font-size: 16px; letter-spacing: 0.04em; }
.shop-card .lot-timer { font-size: 13px; margin-top: 8px; }
.bid-input { width: 140px; }

/* Список диалогов */
.dialogs { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.dialog-row {
  display: grid;
  grid-template-columns: 220px 1fr auto;
  gap: 16px;
  align-items: center;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 16px 20px;
  transition: border-color 0.2s;
}
.dialog-row:hover { border-color: rgba(79, 124, 255, 0.5); color: var(--text); }
.dialog-name { font-size: 14px; font-weight: 600; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.dialog-preview { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dialog-date { font-size: 12px; }
.dialog-input { width: 220px; }
.tag-danger { background: rgba(255, 80, 80, 0.12); border-color: rgba(255, 80, 80, 0.4); color: #ffb0b0; }
@media (max-width: 720px) { .dialog-row { grid-template-columns: 1fr auto; } .dialog-preview { display: none; } }

/* Личные сообщения */
.msg-thread { display: flex; flex-direction: column; gap: 14px; margin: 28px 0; }
.msg {
  max-width: 78%;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 8px 8px 8px 2px;
  padding: 14px 18px;
  align-self: flex-start;
}
.msg-own {
  align-self: flex-end;
  background: var(--accent-soft);
  border-color: rgba(79, 124, 255, 0.4);
  border-radius: 8px 8px 2px 8px;
}
.msg-head { font-size: 12px; color: var(--accent); margin-bottom: 6px; display: flex; gap: 10px; }
.msg-body { font-size: 14px; white-space: normal; }
.msg-form { margin-top: 8px; }

/* Счёт на депозитный взнос в ЛК */
.deposit-invoice {
  margin-top: 20px;
  background: var(--accent-soft);
  border: 1px solid rgba(79, 124, 255, 0.4);
  border-radius: 6px;
  padding: 24px 28px;
}
.deposit-invoice h3 { font-size: 16px; margin-bottom: 10px; }
.deposit-desc { color: var(--muted); font-size: 14px; margin-bottom: 16px; }
.deposit-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.account-info .tag { vertical-align: middle; margin-left: 8px; }

/* Quill в тёмной теме */
.quill-dark { background: var(--bg-soft); min-height: 260px; }
.ql-toolbar.ql-snow { border: 1px solid var(--line); border-radius: 4px 4px 0 0; background: var(--bg-soft); }
.ql-container.ql-snow { border: 1px solid var(--line); border-top: none; border-radius: 0 0 4px 4px; font-size: 15px; }
.ql-snow .ql-stroke { stroke: var(--muted); }
.ql-snow .ql-fill { fill: var(--muted); }
.ql-snow .ql-picker { color: var(--muted); }
.ql-snow .ql-picker-options { background: var(--bg-soft); border-color: var(--line) !important; }
.ql-editor { color: var(--text); }
.ql-editor.ql-blank::before { color: var(--muted); }

@media (max-width: 720px) {
  .form-row, .menu-cols, .shop-item { grid-template-columns: 1fr; }
  /* Таблицы прокручиваются внутри себя — страница не едет вбок */
  .admin-table { display: block; overflow-x: auto; white-space: nowrap; }
  .admin-nav { overflow-x: auto; flex-wrap: nowrap; }
  .admin-nav a { white-space: nowrap; }
}

@media (max-width: 720px) {
  .site-header { flex-wrap: wrap; gap: 14px; padding: 16px 20px; }
  .main-nav { order: 3; width: 100%; }
  .account-card { flex-direction: column; text-align: center; }
  .hero-actions { flex-direction: column; align-items: center; }
}
