:root {
  --bg: #0a0a0c;
  --bg-soft: #121215;
  --card: #17171b;
  --card-hover: #1f1f25;
  --line: #2b2b33;
  --text: #f2eee8;
  --muted: #9b948b;
  --accent: #ff7a1a;
  --accent-dim: #7c3a06;
  --accent-2: #ffb340;
  --accent-2-dim: #6f4a0d;
  --good: #34d399;
  --warn: #facc15;
  --bad: #f87171;
  --info: #60a5fa;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .55);
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  background:
    radial-gradient(1100px 600px at 15% -10%, rgba(255, 122, 26,.13), transparent 60%),
    radial-gradient(900px 500px at 90% 0%, rgba(255, 179, 64,.10), transparent 55%),
    var(--bg);
  color: var(--text);
  /* Системный шрифт: грузить ничего не надо, на каждой ОС берётся «родной»
     и текст выглядит привычно. Внешние шрифты запрещены политикой CSP. */
  font-family: system-ui, -apple-system, "Segoe UI Variable Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Заголовки чуть плотнее основного текста — так страница читается спокойнее */
h1, h2, h3, h4 { letter-spacing: -.4px; font-weight: 700; }

a { color: var(--accent); text-decoration: none; transition: color .15s; }
a:hover { color: var(--accent-2); }

.wrap { width: min(1180px, 100% - 32px); margin-inline: auto; }

/* ---------- Шапка ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(10, 10, 12, .88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; gap: 14px; height: 66px; }
/* Шапке тесно в обычной ширине страницы (1180px): у вошедшего игрока,
   а тем более у персонала, в ней больше ссылок. Даём ей чуть больше места. */
.site-header .wrap { width: min(1440px, 100% - 32px); }

.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 21px; letter-spacing: .5px; color: var(--text); }
.logo:hover { color: var(--text); }
.logo-mark {
  width: 34px; height: 34px; border-radius: 10px; flex: none;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: grid; place-items: center; color: #1a0a00; font-weight: 900; font-size: 18px;
}
.logo span { background: linear-gradient(90deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }

.nav { display: flex; align-items: center; gap: 2px; margin-left: auto; }
.nav a {
  position: relative;
  color: var(--muted); padding: 7px 10px; border-radius: 8px;
  font-weight: 500; font-size: 13.5px; white-space: nowrap;
  transition: color .15s;
}
.nav a:hover { color: var(--text); }
/* Активный пункт отмечаем тонкой чертой снизу, а не заливкой:
   цветных плашек в шапке становится меньше, она перестаёт рябить. */
.nav a::after {
  content: ''; position: absolute; left: 10px; right: 10px; bottom: 2px; height: 2px;
  border-radius: 2px; background: var(--accent);
  transform: scaleX(0); transform-origin: center; transition: transform .2s;
}
.nav a:hover::after { transform: scaleX(.55); }
.nav a.active { color: var(--text); }
.nav a.active::after { transform: scaleX(1); }

/* Разделитель между группами пунктов меню */
.nav-sep { width: 1px; height: 20px; background: var(--line); margin: 0 6px; flex: none; }

/* ---- Соцсети в меню ---- */
.nav-socials { display: flex; align-items: center; gap: 2px; }
.soc {
  width: 32px; height: 32px; border-radius: 9px; flex: none;
  display: grid; place-items: center; color: var(--muted);
  transition: color .15s, background .15s, transform .15s;
}
.soc svg { width: 17px; height: 17px; display: block; }
.soc:hover { color: var(--accent); background: var(--card); transform: translateY(-1px); }
.soc::after { display: none; }

.nav-user { color: var(--text) !important; font-weight: 600; }
.nav-logout { display: inline-flex; margin-left: 2px; }
.nav-cta {
  color: var(--accent) !important;
  border: 1px solid var(--accent-dim); background: rgba(255, 122, 26,.08);
  margin-left: 4px;
}
.nav-cta:hover { background: rgba(255, 122, 26,.16); }
.nav-cta::after { display: none; }

.header-actions { display: flex; align-items: center; gap: 8px; }

/* ---- Переключатель звука ---- */
.sound-toggle {
  width: 34px; height: 34px; flex: none; cursor: pointer;
  border: 1px solid var(--line); border-radius: 9px; background: var(--bg-soft);
  color: var(--muted); display: grid; place-items: center; font-size: 15px; line-height: 1;
  transition: color .15s, border-color .15s;
}
.sound-toggle::before { content: '\1F50A'; }
.sound-toggle.muted::before { content: '\1F507'; }
.sound-toggle:hover { color: var(--text); border-color: var(--accent-dim); }

.ip-button {
  display: inline-flex; align-items: center; gap: 8px;
  background: linear-gradient(135deg, rgba(255, 122, 26,.16), rgba(255, 179, 64,.14));
  border: 1px solid var(--accent-dim); color: var(--text);
  padding: 8px 14px; border-radius: 10px; font-weight: 600; font-family: ui-monospace, monospace;
  cursor: pointer; font-size: 13px; transition: transform .12s, box-shadow .15s;
}
.ip-button:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(255, 122, 26,.2); }
.ip-button.copied { border-color: var(--good); color: var(--good); }

.online-badge {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 13px; color: var(--muted); padding: 7px 12px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--bg-soft);
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--bad); flex: none; }
.dot.on { background: var(--good); box-shadow: 0 0 0 3px rgba(52, 211, 153, .18); }

.burger { display: none; background: none; border: 1px solid var(--line); color: var(--text); border-radius: 9px; padding: 8px 11px; cursor: pointer; font-size: 17px; }

/* ---------- Кнопки ---------- */
.btn {
  position: relative; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--card); color: var(--text); font-weight: 600; font-size: 14px;
  cursor: pointer; font-family: inherit;
  transition: transform .14s cubic-bezier(.34, 1.4, .64, 1), background .15s, border-color .15s, box-shadow .2s;
}
.btn:hover { transform: translateY(-2px); background: var(--card-hover); color: var(--text); box-shadow: 0 6px 16px rgba(0, 0, 0,.35); }
/* Нажатие: кнопка чуть «проваливается» — палец/мышь получают отклик */
.btn:active { transform: translateY(0) scale(.97); transition-duration: .05s; }

/* Блик пробегает по кнопке при наведении */
.btn::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(115deg, transparent 35%, rgba(255, 255, 255,.28) 50%, transparent 65%);
  transform: translateX(-120%); transition: transform .6s;
}
.btn:hover::before { transform: translateX(120%); }

.btn-primary { background: linear-gradient(135deg, var(--accent), #e85d04); border-color: transparent; color: #1a0a00; }
.btn-primary:hover { background: linear-gradient(135deg, #ff9648, var(--accent)); color: #1a0a00; box-shadow: 0 8px 22px rgba(255, 122, 26,.32); }
.btn-secondary { background: linear-gradient(135deg, var(--accent-2), #f59e0b); border-color: transparent; color: #241500; }
.btn-secondary:hover { color: #241500; box-shadow: 0 8px 22px rgba(255, 179, 64,.28); }
.btn-danger { border-color: #7f1d1d; color: var(--bad); }
.btn-danger:hover { border-color: var(--bad); box-shadow: 0 6px 18px rgba(248, 113, 113,.2); }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }
.btn:disabled::before { display: none; }

/* Видимая рамка при навигации с клавиатуры (мышью не мешает) */
.btn:focus-visible, .nav a:focus-visible, .soc:focus-visible,
.ip-button:focus-visible, .sound-toggle:focus-visible, .card-link:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}

/* Уважаем системную настройку «меньше движения» */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  .btn::before { display: none; }
}

/* ---------- Карточки ---------- */
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px;
}
.card-link { display: block; color: inherit; transition: transform .15s, border-color .15s, background .15s; }
.card-link:hover { transform: translateY(-3px); border-color: var(--accent-dim); background: var(--card-hover); color: inherit; }

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }

main { flex: 1; padding: 32px 0 60px; }

.page-head { margin-bottom: 24px; }
.page-head h1 { margin: 0 0 6px; font-size: 30px; letter-spacing: -.5px; }
.page-head p { margin: 0; color: var(--muted); }

h1, h2, h3 { line-height: 1.25; }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 36px 0 16px; }
.section-title h2 { margin: 0; font-size: 21px; }

/* ---------- Hero ---------- */
.hero {
  border: 1px solid var(--line); border-radius: 22px; padding: 56px 40px;
  background:
    radial-gradient(700px 300px at 20% 0%, rgba(255, 122, 26,.16), transparent 65%),
    radial-gradient(600px 300px at 85% 100%, rgba(255, 179, 64,.13), transparent 60%),
    var(--bg-soft);
  text-align: center; position: relative; overflow: hidden;
}
.hero h1 { font-size: clamp(32px, 6vw, 52px); margin: 0 0 14px; letter-spacing: -1.5px; }
.hero h1 span { background: linear-gradient(90deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { color: var(--muted); font-size: 17px; max-width: 620px; margin: 0 auto 28px; }
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

.stat-row { display: flex; gap: 28px; justify-content: center; margin-top: 34px; flex-wrap: wrap; }
.stat { text-align: center; }
.stat b { display: block; font-size: 26px; color: var(--accent-2); }
.stat small { color: var(--muted); font-size: 13px; }

/* ---------- Бейджи ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 600;
  border: 1px solid; white-space: nowrap;
}
.badge.good { color: var(--good); border-color: rgba(52, 211, 153, .35); background: rgba(52, 211, 153, .10); }
.badge.warn { color: var(--warn); border-color: rgba(251, 191, 36, .35); background: rgba(251, 191, 36, .10); }
.badge.bad { color: var(--bad); border-color: rgba(248, 113, 113, .35); background: rgba(248, 113, 113, .10); }
.badge.info { color: var(--info); border-color: rgba(96, 165, 250, .35); background: rgba(96, 165, 250, .10); }
.badge.muted { color: var(--muted); border-color: var(--line); background: var(--bg-soft); }
.badge.accent { color: var(--accent-2); border-color: rgba(255, 179, 64,.35); background: rgba(255, 179, 64,.10); }

/* ---------- Форум ---------- */
.section-card { display: flex; gap: 14px; align-items: flex-start; }
/* Значок раздела сделан спокойнее: нейтральный фон вместо оранжевой плашки,
   цвет проявляется только при наведении на карточку. */
.section-icon {
  width: 38px; height: 38px; border-radius: 11px; flex: none; display: grid; place-items: center;
  background: var(--bg-soft); border: 1px solid var(--line); font-size: 17px;
  transition: background .15s, border-color .15s;
}
.card-link:hover .section-icon { background: rgba(255, 122, 26,.12); border-color: var(--accent-dim); }
.section-card h3 { margin: 0 0 4px; font-size: 17px; }
.section-card p { margin: 0; color: var(--muted); font-size: 14px; }
.section-meta { margin-left: auto; text-align: right; color: var(--muted); font-size: 13px; flex: none; }

.topic-row {
  display: flex; gap: 14px; align-items: center; padding: 14px 18px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--card);
  transition: border-color .15s, background .15s; color: inherit; margin-bottom: 10px;
}
.topic-row:hover { border-color: var(--accent-dim); background: var(--card-hover); color: inherit; }
.topic-main { min-width: 0; flex: 1; }
.topic-title { font-weight: 600; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.topic-sub { color: var(--muted); font-size: 13px; margin-top: 3px; }
.topic-stats { display: flex; gap: 18px; color: var(--muted); font-size: 13px; flex: none; }
.topic-stats b { display: block; color: var(--text); text-align: center; }

.avatar {
  width: 38px; height: 38px; border-radius: 10px; flex: none; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent-dim), var(--accent-2-dim)); color: #fff;
  font-weight: 700; font-size: 15px; text-transform: uppercase;
}
.avatar.lg { width: 64px; height: 64px; font-size: 24px; border-radius: 16px; }

/* ---------- Посты ---------- */
.post { display: flex; gap: 16px; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); margin-bottom: 14px; }
.post-side { width: 120px; flex: none; text-align: center; }
.post-side .avatar { margin: 0 auto 8px; }
.post-author { font-weight: 600; font-size: 14px; word-break: break-word; }
.post-body { flex: 1; min-width: 0; }
.post-head { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; margin-bottom: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }

.prose { overflow-wrap: break-word; }
.prose p { margin: 0 0 12px; }
.prose > :last-child { margin-bottom: 0; }
.prose h1, .prose h2, .prose h3 { margin: 22px 0 10px; }
.prose ul, .prose ol { padding-left: 22px; margin: 0 0 12px; }
.prose li { margin-bottom: 5px; }
.prose code { background: var(--bg-soft); padding: 2px 6px; border-radius: 5px; font-size: 13px; color: var(--accent-2); }
.prose pre { background: var(--bg-soft); padding: 14px; border-radius: 10px; overflow-x: auto; border: 1px solid var(--line); }
.prose pre code { background: none; padding: 0; color: var(--text); }
.prose blockquote { margin: 0 0 12px; padding: 8px 16px; border-left: 3px solid var(--accent-dim); color: var(--muted); background: var(--bg-soft); border-radius: 0 8px 8px 0; }
.prose img { max-width: 100%; border-radius: 10px; }
.prose table { width: 100%; border-collapse: collapse; margin-bottom: 12px; }
.prose th, .prose td { border: 1px solid var(--line); padding: 8px 12px; text-align: left; }
.prose th { background: var(--bg-soft); }

.shots { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.shots a { display: block; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; transition: border-color .15s; }
.shots a:hover { border-color: var(--accent); }
.shots img { display: block; width: 150px; height: 100px; object-fit: cover; }

/* ---------- Формы ---------- */
.form-row { margin-bottom: 16px; }
.form-row label { display: block; margin-bottom: 6px; font-weight: 600; font-size: 14px; }
.form-row .hint { color: var(--muted); font-size: 13px; margin-top: 5px; }

input[type=text], input[type=password], input[type=email], input[type=number],
input[type=date], input[type=url], select, textarea {
  width: 100%; padding: 10px 13px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--bg-soft); color: var(--text);
  font: inherit; font-size: 14px; transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255, 122, 26,.13);
}
textarea { resize: vertical; min-height: 110px; font-family: inherit; }
select { cursor: pointer; }
input[type=file] { color: var(--muted); font-size: 13px; }

.checkbox { display: flex; gap: 9px; align-items: flex-start; font-size: 14px; margin-bottom: 10px; cursor: pointer; }
.checkbox input { margin-top: 3px; flex: none; accent-color: var(--accent); }

.form-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.form-actions { display: flex; gap: 10px; align-items: center; margin-top: 20px; flex-wrap: wrap; }

.auth-box { max-width: 420px; margin: 40px auto; }

/* ---------- Сообщения ---------- */
.flash { padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; border: 1px solid; font-size: 14px; }
.flash.ok { color: var(--good); border-color: rgba(52, 211, 153, .35); background: rgba(52, 211, 153, .08); }
.flash.err { color: var(--bad); border-color: rgba(248, 113, 113, .35); background: rgba(248, 113, 113, .08); }
.flash.info { color: var(--info); border-color: rgba(96, 165, 250, .35); background: rgba(96, 165, 250, .08); }

.empty { text-align: center; padding: 50px 20px; color: var(--muted); border: 1px dashed var(--line); border-radius: var(--radius); }

/* ---------- Таблицы ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 760px; }
table.data th, table.data td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--line); }
table.data th { background: var(--bg-soft); font-size: 12px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); font-weight: 600; white-space: nowrap; }
table.data th a { color: var(--muted); }
table.data th a:hover { color: var(--accent); }
table.data tbody tr { transition: background .12s; }
table.data tbody tr:hover { background: var(--card-hover); }
table.data tbody tr:last-child td { border-bottom: none; }
table.data td.num { color: var(--muted); font-family: ui-monospace, monospace; font-size: 13px; }

.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 24px; flex-wrap: wrap; }
.pagination a, .pagination span {
  padding: 7px 13px; border-radius: 9px; border: 1px solid var(--line);
  background: var(--card); color: var(--muted); font-size: 14px;
}
.pagination a:hover { border-color: var(--accent-dim); color: var(--text); }
.pagination .current { background: var(--accent); color: #1a0a00; border-color: transparent; font-weight: 600; }

/* ---------- Админка ---------- */
.admin-layout { display: grid; grid-template-columns: 220px 1fr; gap: 24px; align-items: start; }
.admin-nav { position: sticky; top: 86px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; }
.admin-nav a { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 9px 12px; border-radius: 9px; color: var(--muted); font-size: 14px; font-weight: 500; }
.admin-nav a:hover { background: var(--bg-soft); color: var(--text); }
.admin-nav a.active { background: rgba(255, 122, 26,.12); color: var(--accent); }
.admin-nav .count { background: var(--bad); color: #fff; border-radius: 10px; padding: 1px 7px; font-size: 11px; font-weight: 700; }
.admin-nav hr { border: none; border-top: 1px solid var(--line); margin: 8px 4px; }

.kpi { padding: 18px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--card); }
.kpi b { display: block; font-size: 30px; line-height: 1.1; color: var(--accent-2); }
.kpi small { color: var(--muted); font-size: 13px; }

.tabs { display: flex; gap: 6px; margin-bottom: 16px; flex-wrap: wrap; }
.tabs a { padding: 7px 14px; border-radius: 20px; border: 1px solid var(--line); background: var(--card); color: var(--muted); font-size: 13px; font-weight: 500; }
.tabs a:hover { border-color: var(--accent-dim); color: var(--text); }
.tabs a.active { background: var(--accent); border-color: transparent; color: #1a0a00; font-weight: 600; }

.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 16px; padding: 16px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.filters .f { display: flex; flex-direction: column; gap: 5px; }
.filters label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.filters select, .filters input { min-width: 140px; padding: 8px 11px; font-size: 13px; }

.bulk-bar { display: flex; gap: 10px; align-items: center; padding: 12px 16px; background: var(--bg-soft); border: 1px solid var(--accent-dim); border-radius: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.bulk-bar select { min-width: 160px; padding: 7px 11px; font-size: 13px; }
.bulk-bar.is-idle { display: none; }

.detail-grid { display: grid; grid-template-columns: 1fr 330px; gap: 20px; align-items: start; }
.side-panel { position: sticky; top: 86px; display: grid; gap: 16px; }
.field-list { display: grid; gap: 10px; font-size: 14px; }
.field-list div { display: flex; justify-content: space-between; gap: 12px; }
.field-list dt, .field-list .k { color: var(--muted); }

.note { padding: 12px 14px; background: rgba(255, 179, 64,.07); border: 1px solid rgba(255, 179, 64,.25); border-radius: 10px; margin-bottom: 10px; font-size: 14px; }
.note .meta { color: var(--muted); font-size: 12px; margin-bottom: 5px; }

.history { display: grid; gap: 8px; font-size: 13px; color: var(--muted); }
.history b { color: var(--text); }

/* ---------- Футер ---------- */
.site-footer { border-top: 1px solid var(--line); background: var(--bg-soft); padding: 32px 0; margin-top: auto; }
.footer-inner { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; color: var(--muted); font-size: 14px; }
.footer-brand { font-weight: 800; font-size: 17px; color: var(--text); letter-spacing: .3px; margin-bottom: 2px; }
.footer-ip { margin-top: 8px; font-size: 13px; }
.footer-ip code { background: var(--card); border: 1px solid var(--line); border-radius: 6px; padding: 2px 7px; font-size: 12.5px; color: var(--accent-2); }

.footer-links { display: flex; flex-direction: column; gap: 8px; }
.footer-links a { color: var(--muted); }
.footer-links a:hover { color: var(--text); }
.footer-donate { color: var(--accent) !important; font-weight: 600; }
.footer-donate:hover { color: var(--accent-2) !important; }

.socials { display: flex; gap: 10px; align-items: flex-start; }
.socials a {
  width: 38px; height: 38px; border-radius: 11px; flex: none;
  border: 1px solid var(--line); background: var(--card);
  display: grid; place-items: center; color: var(--muted);
  transition: color .15s, border-color .15s, transform .15s;
}
.socials a svg { width: 19px; height: 19px; display: block; }
.socials a:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }

.board-list { display: flex; flex-wrap: wrap; gap: 6px; }
.board-list .badge { font-family: ui-monospace, monospace; font-weight: 500; }

/* ---------- Топы ---------- */
.top-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.top-board h3 { margin: 0; font-size: 17px; flex: 1; min-width: 0; }
/* Кнопка-переключатель «Топ ↔ Награды»: в активном состоянии подсвечена,
   чтобы было видно, что карточка сейчас показывает не игроков, а призы. */
.top-switch { flex: none; }
.top-switch.on { color: var(--accent); border-color: var(--accent-dim); background: rgba(255, 122, 26, .1); }
.top-note { color: var(--muted); font-size: 12.5px; line-height: 1.5; padding-top: 10px; }
.top-row { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.top-row:last-child { border-bottom: 0; }
.top-place {
  width: 24px; height: 24px; flex: none; border-radius: 7px;
  display: grid; place-items: center; font-size: 12px; font-weight: 700;
  color: var(--muted); background: var(--bg-soft);
}
/* Первая тройка выделена — её ищут глазами в первую очередь */
.top-place.medal { color: #1a0a00; background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
.top-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-value { color: var(--accent); font-variant-numeric: tabular-nums; white-space: nowrap; }
/* Ник того, кто сейчас держит место: справа от награды, длинные ники обрезаем. */
.top-holder {
  flex: none; max-width: 45%; color: var(--accent); font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.top-holder.is-free { color: var(--muted); font-weight: 500; }
.top-empty { color: var(--muted); font-size: 14px; }

/* ---------- Правила ---------- */
.rules-layout { display: grid; grid-template-columns: 250px 1fr; gap: 28px; align-items: start; }

.rules-toc {
  position: sticky; top: 86px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px; display: grid; gap: 2px;
}
.rules-toc-title { font-size: 12px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); margin: 2px 4px 8px; }
.rules-toc a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: 9px; color: var(--muted); font-size: 14px;
  transition: background .15s, color .15s;
}
.rules-toc a:hover { background: var(--bg-soft); color: var(--text); }
.rules-toc-num {
  width: 22px; height: 22px; flex: none; border-radius: 7px;
  display: grid; place-items: center; font-size: 12px; font-weight: 700;
  background: var(--bg-soft); border: 1px solid var(--line); color: var(--accent-2);
}
.rules-toc-count { margin-left: auto; font-size: 12px; color: var(--muted); }

.rules-section { margin-bottom: 34px; }
/* Шапка сайта «прилипшая», поэтому при переходе по якорю заголовок
   уезжал бы под неё — этот отступ его возвращает. */
.rules-section, .rule { scroll-margin-top: 82px; }

.rules-section-head {
  display: flex; align-items: center; gap: 12px;
  margin: 0 0 14px; font-size: 22px;
  padding-bottom: 12px; border-bottom: 1px solid var(--line);
}
.rules-section-num {
  width: 30px; height: 30px; flex: none; border-radius: 9px;
  display: grid; place-items: center; font-size: 15px; font-weight: 800;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #1a0a00;
}
.rules-section-head small { margin-left: auto; font-size: 13px; font-weight: 500; color: var(--muted); }

.rule {
  display: flex; gap: 14px; padding: 14px 16px; margin-bottom: 8px;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  transition: border-color .15s, background .15s;
}
.rule:hover { border-color: var(--accent-dim); background: var(--card-hover); }
/* Подсветка пункта, на который пришли по прямой ссылке */
.rule:target { border-color: var(--accent); background: rgba(255, 122, 26,.07); }

.rule-num {
  flex: none; min-width: 42px; height: 26px; padding: 0 8px;
  display: grid; place-items: center; border-radius: 8px;
  background: var(--bg-soft); border: 1px solid var(--line);
  color: var(--accent-2); font-weight: 700; font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.rule-num:hover { border-color: var(--accent); color: var(--accent); }
.rule-body { min-width: 0; flex: 1; }
.rule-text { margin: 2px 0 0; }
.rule-note { margin: 6px 0 0; font-size: 13px; color: var(--muted); }
.rule-punish { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }

.rules-foot {
  padding: 16px 18px; border-radius: 12px; font-size: 14px; color: var(--muted);
  background: var(--bg-soft); border: 1px dashed var(--line);
}

@media (max-width: 900px) {
  .rules-layout { grid-template-columns: 1fr; }
  .rules-toc { position: static; }
  .rules-toc a { padding: 8px 10px; }
}

/* ---------- Колокольчик уведомлений ---------- */
.nav-bell {
  position: relative; width: 34px; height: 34px; flex: none;
  display: grid; place-items: center; border-radius: 9px;
  border: 1px solid var(--line); background: var(--bg-soft); color: var(--muted);
  transition: color .15s, border-color .15s;
}
.nav-bell svg { width: 17px; height: 17px; }
.nav-bell:hover { color: var(--text); border-color: var(--accent-dim); }
.nav-bell.has-new { color: var(--accent); border-color: var(--accent-dim); }
.nav-bell-count {
  position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: var(--bad); color: #fff; font-size: 11px; font-weight: 700;
  display: grid; place-items: center; line-height: 1; border: 2px solid var(--bg);
}

.notif-list { display: grid; gap: 8px; }
.notif {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--card); color: var(--muted);
  transition: border-color .15s, background .15s;
}
.notif:hover { border-color: var(--accent-dim); background: var(--card-hover); }
.notif.unread { color: var(--text); border-color: var(--accent-dim); }
.notif-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--line); }
.notif.unread .notif-dot { background: var(--accent); box-shadow: 0 0 0 3px rgba(255, 122, 26, .18); }
.notif-text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.notif-time { flex: none; font-size: 12px; color: var(--muted); }

/* ---------- Голосование за идеи ---------- */
.vote-box { margin-bottom: 20px; }
.vote-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.vote-head b { font-size: 16px; }
.vote-total { color: var(--muted); font-size: 13px; }
.vote-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.vote-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 14px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg-soft);
  color: var(--text); font-family: inherit; font-size: 15px; cursor: pointer;
  transition: transform .14s cubic-bezier(.34, 1.4, .64, 1), border-color .15s, background .15s;
}
.vote-btn:hover { transform: translateY(-2px); }
.vote-btn:active { transform: scale(.97); }
.vote-btn.static { cursor: default; }
.vote-btn.static:hover { transform: none; }
.vote-icon { font-size: 13px; }
.vote-num { font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; }
.vote-label { color: var(--muted); }
.vote-btn.up .vote-icon, .vote-btn.up .vote-num { color: var(--good); }
.vote-btn.down .vote-icon, .vote-btn.down .vote-num { color: var(--bad); }
.vote-btn.up:hover, .vote-btn.up.on { border-color: rgba(52, 211, 153, .5); background: rgba(52, 211, 153, .08); }
.vote-btn.down:hover, .vote-btn.down.on { border-color: rgba(248, 113, 113, .5); background: rgba(248, 113, 113, .08); }
.vote-btn.on { box-shadow: inset 0 0 0 1px currentColor; }
.vote-btn.up.on { color: var(--good); }
.vote-btn.down.on { color: var(--bad); }
.vote-bar { height: 6px; border-radius: 3px; margin-top: 12px; overflow: hidden; background: rgba(248, 113, 113, .55); }
.vote-bar-up { display: block; height: 100%; background: var(--good); }
.vote-hint { margin-top: 10px; font-size: 13px; color: var(--muted); }
.votes-mini .up { color: var(--good); }
.votes-mini .down { color: var(--bad); }

/* ---------- Личная переписка и скрытые темы ---------- */
.private-box { margin-bottom: 20px; border-color: rgba(255, 179, 64, .35); background: linear-gradient(180deg, rgba(255, 179, 64, .05), transparent 120px), var(--card); }
.private-intro { color: var(--muted); margin-top: -4px; font-size: 14px; }
.private-details { margin-top: 20px; }
.private-details summary { cursor: pointer; font-weight: 600; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.private-details summary:hover { color: var(--accent); }
.private-details[open] summary { margin-bottom: 14px; }
.private-details .private-intro { margin-top: 0; }
.private-box .post { background: var(--bg-soft); }
.post-private { border-color: rgba(255, 179, 64, .3); }

.hidden-stub { display: flex; gap: 16px; align-items: flex-start; }
.hidden-stub-icon { font-size: 30px; line-height: 1; flex: none; }

.post-edit { margin-top: 12px; }
.post-edit summary { cursor: pointer; color: var(--muted); font-size: 13px; width: max-content; }
.post-edit summary:hover { color: var(--accent); }
.post-edit[open] summary { margin-bottom: 10px; }

.shot-video { display: block; width: 100%; max-width: 480px; max-height: 320px; border-radius: 10px; border: 1px solid var(--line); background: #000; }

.reply-mode { display: flex; flex-wrap: wrap; gap: 4px 20px; margin: 12px 0 4px; }

/* ---------- Админка: непрочитанное ---------- */
.unseen-dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: middle;
  background: var(--bad); box-shadow: 0 0 0 3px rgba(248, 113, 113, .18);
}
.row-unseen td:first-child { box-shadow: inset 3px 0 0 var(--bad); }
.card.row-unseen { border-color: rgba(248, 113, 113, .4); }
.tab-count { background: var(--bad); color: #fff; border-radius: 9px; padding: 0 6px; font-size: 11px; font-weight: 700; }

/* Кнопка, которая выглядит как ссылка: «удалить» у заметок и наград. */
.link-btn {
  background: none; border: 0; padding: 0; font: inherit; font-size: 12px;
  color: var(--muted); cursor: pointer; text-decoration: underline; text-underline-offset: 2px;
}
.link-btn:hover { color: var(--text); }
.link-btn.danger:hover { color: var(--bad); }

.app-card.is-priority { border-left: 3px solid var(--accent-2); }
.app-reviewed { color: var(--muted); font-size: 13px; margin-bottom: 8px; }

.reward-edit { display: grid; gap: 6px; min-width: 260px; }
.reward-edit input, .reward-edit select { padding: 6px 9px; font-size: 13px; }
.reward-edit-row { display: flex; gap: 6px; }
.reward-edit-row select { flex: 1; }

.rep-good { color: var(--good); }
.rep-bad { color: var(--bad); }

/* ---------- Набор: карточки должностей ---------- */
.positions-grid { margin-bottom: 20px; }
.position-card p { margin: 6px 0 0; color: var(--muted); font-size: 14px; }
.position-head { display: flex; align-items: center; gap: 10px; justify-content: space-between; }
.position-head h3 { margin: 0; font-size: 17px; }
.position-card.is-priority { border-color: rgba(255, 179, 64, .45); }

@media (max-width: 560px) {
  /* Телефон: в шапке остаются значок «P», колокольчик, звук, IP и меню —
     надпись «Paradise» прячем, иначе строка не влезает в экран. */
  .logo span:not(.logo-mark) { display: none; }
  .header-actions { gap: 6px; }
  .ip-button { padding: 7px 9px; font-size: 11px; }
  .vote-num { font-size: 19px; }
  .vote-btn { padding: 12px 8px; gap: 7px; }
  .notif { flex-wrap: wrap; }
  .notif-time { width: 100%; padding-left: 20px; }
  .hidden-stub { flex-direction: column; }
}

/* ---------- Появление содержимого ---------- */
/* Лёгкое всплытие блока при загрузке страницы: без него переходы
   выглядят резко. Анимация одноразовая и очень короткая. */
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
main > .wrap > * { animation: rise .32s ease both; }

/* ---------- Адаптив ---------- */
/* На ноутбучных экранах шапке не хватает ширины: сначала прячем плашку
   онлайна (то же число есть на главной), потом убираем меню в «бургер». */
@media (max-width: 1480px) {
  .online-badge { display: none; }
}
@media (max-width: 1080px) {
  .nav a { padding: 7px 8px; font-size: 13px; }
  .ip-button { padding: 8px 10px; font-size: 12px; }
}

@media (max-width: 980px) {
  .admin-layout { grid-template-columns: 1fr; }
  .admin-nav { position: static; display: flex; flex-wrap: wrap; gap: 4px; }
  .admin-nav hr { display: none; }
  .detail-grid { grid-template-columns: 1fr; }
  .side-panel { position: static; }
}

/* Меню прячется в «бургер», как только перестаёт помещаться в строку.
   У вошедшего игрока (и тем более у персонала со ссылкой «Админка») шапка
   шире, поэтому переключаемся уже на 1320px, а не только на телефонах. */
@media (max-width: 1320px) {
  .burger { display: block; }
  .nav {
    display: none; position: absolute; top: 66px; left: 0; right: 0;
    flex-direction: column; background: var(--bg-soft); border-bottom: 1px solid var(--line);
    padding: 10px; gap: 2px;
  }
  .nav.open { display: flex; }
  .nav { align-items: stretch; }
  .nav a { padding: 10px 12px; font-size: 15px; }
  .nav a::after { display: none; }
  .nav a.active { color: var(--accent); background: rgba(255, 122, 26,.10); }
  /* В выпадающем меню разделитель — горизонтальная линия, а не палочка */
  .nav-sep { width: auto; height: 1px; margin: 6px 4px; }
  .nav-socials { justify-content: center; gap: 8px; padding: 4px 0; }
  .soc { width: 40px; height: 40px; }
  .soc svg { width: 20px; height: 20px; }
  .nav-logout { margin: 4px 0 0; }
  .nav-logout .btn { width: 100%; }
  .nav-cta { margin: 4px 0 0; text-align: center; }
  .header-inner { position: relative; }
  .online-badge { display: none; }
  /* Меню спрятано — кнопки справа прижимаем к краю сами. */
  .header-actions { margin-left: auto; }
}

@media (max-width: 760px) {
  .hero { padding: 40px 22px; }
  .post { flex-direction: column; gap: 12px; }
  .post-side { width: auto; display: flex; align-items: center; gap: 10px; text-align: left; }
  .post-side .avatar { margin: 0; }
  .topic-stats { display: none; }
  .footer-inner { flex-direction: column; }
}
