/* =========================================================
   ПОВЕЛИТЕЛЬ ТАЙН — Справочник по правилам
   Design tokens — тёмно-серый архив с золотым тиснением
   ========================================================= */

:root {
  /* Color — угольно-серый архив, золотое тиснение */
  --void:        #17171a;
  --panel:       #1c1d20;
  --panel-2:     #212226;
  --card:        #1e1f23;
  --card-border: #35363b;
  --hairline:    #313236;

  --gold:        #b4924f;
  --gold-bright: #e3c583;
  --gold-dim:    #6b592f;
  --gold-wash:   rgba(196,164,94,0.08);

  --ink-parchment: #dcd8cf;
  --ink-muted:     #9a998f;
  --ink-faint:     #616157;

  --font-display: 'Cinzel', 'Cinzel Decorative', serif;
  --font-body:    'EB Garamond', Georgia, serif;
  --font-mono:    'IBM Plex Mono', ui-monospace, monospace;

  --radius: 2px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--void); scrollbar-color: var(--gold-dim) var(--panel); scrollbar-width: thin; }

::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: var(--panel); }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--gold-dim), var(--gold));
  border-radius: 8px;
  border: 2px solid var(--panel);
}
::-webkit-scrollbar-thumb:hover { background: linear-gradient(180deg, var(--gold), var(--gold-bright)); }
::-webkit-scrollbar-corner { background: var(--panel); }

body {
  margin: 0;
  background: var(--void);
  background-image:
    radial-gradient(ellipse 1000px 560px at 50% -12%, rgba(196,164,94,0.06), transparent 60%),
    repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(255,255,255,0.008) 3px);
  color: var(--ink-parchment);
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
::selection { background: var(--gold-dim); color: #fff; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}

/* ---------------------------------------------------------
   Layout helpers
   --------------------------------------------------------- */

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 32px; }

@media (max-width: 600px) {
  .wrap { padding: 0 18px; }
  body { font-size: 16px; }
  .site-footer .wrap { flex-direction: column; align-items: flex-start; }
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
}

.rule {
  height: 1px;
  background: linear-gradient(90deg, var(--gold-dim), transparent);
  border: none;
}

/* Ornamental flourish divider — тонкая золотая линия с ромбом в центре */
.flourish {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--gold-dim);
  margin: 0;
}
.flourish::before,
.flourish::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-dim));
}
.flourish::after { background: linear-gradient(90deg, var(--gold-dim), transparent); }
.flourish svg { flex-shrink: 0; color: var(--gold); }
.flourish.left::before { display:none; }
.flourish.left { justify-content: flex-start; }

/* ---------------------------------------------------------
   Site header / nav
   Шапка: стеклянная капсула меню с «живым» золотым индикатором (nav.js), луч света за курсором,
   полоса прогресса чтения под шапкой, анимированный знак и чип профиля. Ниже 1260px — выезжающее меню.
   --------------------------------------------------------- */

:root {
  --nav-rgb: 212,175,55;                              /* цвет индикатора меню (на «Зодиаках» — синий) */
  --spring: cubic-bezier(.3, 1.3, .4, 1);             /* пружина: запасной вариант */
}
@supports (transition-timing-function: linear(0, 1)) {
  :root { --spring: linear(0, 0.0415, 0.1425, 0.2742, 0.4157, 0.5526, 0.6759, 0.7808, 0.8658, 0.9312, 0.9789, 1.0114, 1.0316, 1.0423, 1.0459, 1.0447, 1.0405, 1.0346, 1.0281, 1.0217, 1.0159, 1.0109, 1.0068, 1.0037, 1.0013, 0.9997, 0.9987, 0.9981, 0.9979, 0.9979, 0.9981, 0.9984, 0.9987, 0.9989, 1); }
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(20,20,23,0.78);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  backdrop-filter: blur(14px) saturate(1.3);
  border-bottom: 1px solid var(--hairline);
  transition: background-color .35s ease, border-color .35s ease, box-shadow .35s ease;
}
/* после прокрутки шапка «собирается»: плотнее фон, золотая кромка и тень */
.site-header.is-scrolled {
  background: rgba(15,15,18,0.92);
  border-bottom-color: rgba(212,175,55,0.16);
  box-shadow: 0 16px 36px -20px rgba(0,0,0,0.9);
}
/* полоса прогресса чтения: тянется вдоль нижней кромки шапки (--sp 0..1 ставит nav.js) */
.site-header::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 2px;
  transform-origin: 0 50%;
  transform: scaleX(var(--sp, 0));
  background: linear-gradient(90deg, var(--gold-dim), var(--gold-bright) 72%, #fff4cc);
  box-shadow: 0 0 12px rgba(227,197,131,0.55);
  opacity: var(--spo, 0);
  pointer-events: none;
  transition: opacity .35s ease;
}

.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 78px;
  max-width: none;
}

/* Золотой словесный знак «в обвивке» — при наведении свиток прорисовывается заново, глаз пульсирует, надпись светится */
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-right: auto;
}
.brand .scroll {
  color: var(--gold-dim);
  flex-shrink: 0;
  overflow: visible;
  transition: color .4s ease, transform .7s var(--spring), filter .4s ease;
}
.brand .scroll path { stroke-dasharray: 40; stroke-dashoffset: 0; }
.brand .scroll circle { transform-box: fill-box; transform-origin: center; }
.brand:hover .scroll, .brand:focus-visible .scroll {
  color: var(--gold-bright);
  transform: rotate(-5deg) scale(1.12);
  filter: drop-shadow(0 0 7px rgba(227,197,131,0.55));
}
.brand:hover .scroll path, .brand:focus-visible .scroll path { animation: brand-draw 1.1s cubic-bezier(.5, 0, .2, 1); }
.brand:hover .scroll circle, .brand:focus-visible .scroll circle { animation: brand-eye 1.8s ease-in-out infinite; }
@keyframes brand-draw { from { stroke-dashoffset: 40; } to { stroke-dashoffset: 0; } }
@keyframes brand-eye { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.9); opacity: .7; } }
.brand .word {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}
.brand .word b {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 18px;
  letter-spacing: 0.09em;
  color: var(--gold-bright);
  text-transform: uppercase;
}
/* надпись: при наведении светлеет и мягко светится (градиентный текст через background-clip не используем:
   поверх видео и под размытой шапкой он в Chrome исчезает) */
.brand .word b { transition: color .45s ease, text-shadow .45s ease; }
.brand:hover .word b, .brand:focus-visible .word b { color: #fff1c4; text-shadow: 0 0 18px rgba(227,197,131,0.55); }
.brand .word small {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  color: var(--ink-faint);
  text-transform: uppercase;
  margin-top: 3px;
}

/* ---- меню-капсула ----
   Золотой индикатор (.nav-ind) создаёт и двигает nav.js: он скользит под пункт, на который наведён курсор,
   с лёгкой пружиной, и возвращается к текущей странице. Разделы мира · инструменты · сообщество — тонкие черты (6-й и 9-й пункты). */
.site-nav {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 4px;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255,255,255,0.035), rgba(255,255,255,0.012));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04), 0 10px 28px -16px rgba(0,0,0,0.8);
}
/* луч света, который идёт за курсором внутри капсулы */
.site-nav::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(150px 56px at var(--sx, 50%) 50%, rgba(255,255,255,0.085), transparent 72%);
  opacity: var(--so, 0);
  transition: opacity .35s ease;
}
.site-nav a {
  position: relative;
  z-index: 2;
  color: var(--ink-muted);
  padding: 9px 14px;
  border: 1px solid transparent;
  border-radius: 999px;
  white-space: nowrap;
  transition: color .25s ease, background-color .25s ease, border-color .25s ease, box-shadow .25s ease;
}
.site-nav a:hover, .site-nav a:focus-visible { color: var(--ink-parchment); }
.site-nav a:focus-visible { outline: 2px solid rgba(var(--nav-rgb), 0.7); outline-offset: 1px; }
.site-nav a.active { color: var(--gold-bright); }
/* запасной вид без скрипта */
.site-nav:not(.nav-fx) a:hover { background: rgba(255,255,255,0.055); }
.site-nav:not(.nav-fx) a.active {
  background: linear-gradient(180deg, rgba(212,175,55,0.17), rgba(212,175,55,0.05));
  border-color: rgba(212,175,55,0.34);
  box-shadow: 0 0 20px rgba(212,175,55,0.10), inset 0 1px 0 rgba(255,236,170,0.09);
}
.site-nav a:nth-child(7), .site-nav a:nth-child(10) { margin-left: 12px; }
.site-nav a:nth-child(7)::before, .site-nav a:nth-child(10)::before {
  content: "";
  position: absolute;
  left: -8px; top: 24%; bottom: 24%;
  width: 1px;
  background: var(--card-border);
}

/* индикатор: золотая плашка у текущей страницы и светлая — у пункта под курсором */
.nav-ind {
  position: absolute;
  z-index: 1;
  left: 0; top: 0;
  width: var(--iw, 0px); height: var(--ih, 0px);
  translate: var(--ix, 0px) var(--iy, 0px);
  border-radius: 999px;
  pointer-events: none;
  opacity: 0;
}
.nav-ind.on { opacity: 1; }
.nav-ind.ready { transition: translate .62s var(--spring), width .62s var(--spring), height .3s ease, scale .25s ease, opacity .25s ease; }
.nav-ind.is-press { scale: 0.95; }
.nav-ind::before, .nav-ind::after { content: ""; position: absolute; inset: 0; border-radius: inherit; transition: opacity .3s ease; }
.nav-ind::before {
  background:
    linear-gradient(100deg, transparent 36%, rgba(255,240,190,0.2) 50%, transparent 64%) -160% 0 / 60% 100% no-repeat,
    linear-gradient(180deg, rgba(var(--nav-rgb), 0.2), rgba(var(--nav-rgb), 0.06));
  border: 1px solid rgba(var(--nav-rgb), 0.4);
  box-shadow: 0 0 22px rgba(var(--nav-rgb), 0.15), inset 0 1px 0 rgba(255,236,170,0.1);
  animation: nav-shine 6s ease-in-out infinite;
}
.nav-ind::after {
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.1);
  opacity: 0;
}
.nav-ind.is-hover::before { opacity: 0; }
.nav-ind.is-hover::after { opacity: 1; }
@keyframes nav-shine { 0%, 62% { background-position: -160% 0, 0 0; } 100% { background-position: 260% 0, 0 0; } }

/* Mobile nav toggle — скрыт на десктопе, ниже 1260px показан кнопкой-бургером */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid var(--card-border);
  border-radius: 12px;
  background: rgba(255,255,255,0.02);
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color .25s ease, background-color .25s ease, box-shadow .25s ease;
}
.nav-toggle:hover, .nav-toggle[aria-expanded="true"] { border-color: var(--gold-dim); background: var(--gold-wash); box-shadow: 0 0 18px rgba(212,175,55,0.1); }
.nav-toggle span {
  display: block;
  width: 18px;
  height: 1.5px;
  border-radius: 2px;
  background: var(--ink-parchment);
  transition: transform .45s var(--spring), opacity .2s ease, background-color .25s ease;
}
.nav-toggle[aria-expanded="true"] span { background: var(--gold-bright); }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; transform: scaleX(.3); }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* затемнение страницы под открытым меню (создаёт nav.js) */
.nav-scrim {
  position: fixed;
  left: 0; right: 0; bottom: 0; top: 68px;
  z-index: 35;
  background: rgba(5,5,6,0.62);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .4s ease;
}
.nav-scrim.on { opacity: 1; pointer-events: auto; }

@media (max-width: 480px) {
  .site-header .wrap { gap: 10px; }
  .brand { gap: 8px; }
  .brand .scroll { width: 24px; height: 18px; }
  .brand .word b { font-size: 14px; letter-spacing: 0.04em; }
  .brand .word small { display: none; }
}

/* выезжающее меню: панель раскрывается сверху, пункты по очереди «подплывают» (--i ставит nav.js) */
@media (max-width: 1260px) {
  .site-header .wrap { height: 68px; }
  .nav-toggle { display: flex; }
  .nav-ind { display: none; }
  .site-nav {
    position: fixed;
    top: 68px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 6px 0 14px;
    border: 0;
    border-bottom: 1px solid rgba(212,175,55,0.2);
    border-radius: 0 0 22px 22px;
    background: rgba(14,14,17,0.97);
    box-shadow: 0 34px 60px -24px rgba(0,0,0,0.9);
    max-height: calc(100vh - 68px);
    overflow-y: auto;
    clip-path: inset(0 0 100% 0);
    opacity: 0;
    pointer-events: none;
    transition: clip-path .5s cubic-bezier(.2, .8, .2, 1), opacity .25s ease;
  }
  .site-nav::before { display: none; }
  .site-nav.is-open {
    clip-path: inset(0 0 -40px 0);
    opacity: 1;
    pointer-events: auto;
  }
  .site-nav a {
    padding: 16px 32px;
    width: 100%;
    border: 0;
    border-bottom: 1px solid var(--hairline);
    border-left: 3px solid transparent;
    border-radius: 0;
    box-shadow: none;
    opacity: 0;
    transform: translateY(-12px);
    transition: opacity .4s ease, transform .5s var(--spring), background-color .25s ease, border-color .25s ease, color .25s ease;
  }
  .site-nav.is-open a {
    opacity: 1;
    transform: none;
    transition-delay: calc(var(--i, 0) * 38ms + 110ms), calc(var(--i, 0) * 38ms + 110ms), 0s, 0s, 0s;
  }
  .site-nav a:nth-child(7), .site-nav a:nth-child(10) { margin-left: 0; }
  .site-nav a:nth-child(7)::before, .site-nav a:nth-child(10)::before { left: 32px; right: 32px; top: -1px; bottom: auto; width: auto; height: 1px; background: rgba(212,175,55,0.28); }
  .site-nav a:hover, .site-nav a.active, .site-nav:not(.nav-fx) a.active {
    border-bottom-color: var(--hairline);
    border-left-color: var(--gold);
    background: var(--gold-wash);
    box-shadow: none;
  }
}

/* ---------------------------------------------------------
   Auth area (header) — чип профиля с аватаром, «Админ-панель», «Выйти» / кнопка «Войти»
   --------------------------------------------------------- */

.auth-area {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-left: 18px;
  margin-left: 4px;
  border-left: 1px solid var(--card-border);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  flex-shrink: 0;
}
.auth-area .auth-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 1px 12px 1px 1px;
  border: 1px solid transparent;
  border-radius: 999px;
  text-decoration: none;
  transition: background-color .25s ease, border-color .25s ease, transform .5s var(--spring);
}
.auth-area .auth-chip:hover { background: rgba(255,255,255,0.05); border-color: rgba(255,255,255,0.09); transform: translateY(-1px); }
.auth-area .auth-chip .rf { width: 26px; height: 26px; margin: 4px; flex: none; }
.auth-area .auth-chip .rf .rf-letter { font-size: 12px; }
.auth-area .auth-chip .rf::before { inset: -3px; }
.auth-area .auth-name {
  color: var(--ink-muted);
  text-transform: none;
  letter-spacing: 0;
  font-size: 12.5px;
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.auth-area .auth-link {
  position: relative;
  overflow: hidden;
  color: var(--gold-bright);
  background: none;
  border: 1px solid var(--gold-dim);
  border-radius: 999px;
  padding: 8px 14px;
  margin: 0;
  cursor: pointer;
  font: inherit;
  letter-spacing: inherit;
  text-transform: uppercase;
  white-space: nowrap;
  transition: color .25s ease, background-color .25s ease, border-color .25s ease, box-shadow .25s ease;
}
.auth-area .auth-link:hover { background: var(--gold-wash); border-color: var(--gold); color: var(--gold-bright); text-decoration: none; box-shadow: 0 0 18px rgba(212,175,55,0.14); }
/* «Выйти» — спокойная кнопка без рамки, чтобы случайно не нажать вместо «Админ-панели» */
.auth-area .auth-logout { color: var(--ink-muted); border-color: transparent; padding: 8px 10px; }
.auth-area .auth-logout:hover { color: var(--ink-parchment); background: rgba(255,255,255,0.055); border-color: transparent; box-shadow: none; }
/* «Войти» (единственная кнопка, когда никто не вошёл) — главная: золотая заливка с бликом при наведении */
.auth-area .auth-link:only-child {
  color: #1b1409;
  font-weight: 600;
  padding: 9px 20px;
  border-color: transparent;
  background: linear-gradient(160deg, var(--gold-bright), var(--gold));
  box-shadow: 0 6px 18px -8px rgba(212,175,55,0.7);
}
.auth-area .auth-link:only-child::after {
  content: "";
  position: absolute; top: 0; bottom: 0; left: 0; width: 45%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,0.55), transparent);
  transform: translateX(-130%) skewX(-18deg);
  transition: transform .8s cubic-bezier(.3, .6, .2, 1);
}
.auth-area .auth-link:only-child:hover { color: #1b1409; background: linear-gradient(160deg, #f1d796, var(--gold)); box-shadow: 0 8px 24px -8px rgba(227,197,131,0.85); }
.auth-area .auth-link:only-child:hover::after { transform: translateX(330%) skewX(-18deg); }

@media (max-width: 780px) {
  .auth-area { padding-left: 0; margin-left: 0; border-left: 0; gap: 2px; }
  .auth-area .auth-name { display: none; }
  .auth-area .auth-chip { padding: 0; }
  .auth-area .auth-link:not(:only-child) { border-color: transparent; padding: 6px 8px; }
}
@media (max-width: 480px) {
  .auth-area .auth-link:not(:only-child) { padding: 6px 3px; font-size: 10.5px; letter-spacing: 0.02em; }
  .auth-area .auth-link:only-child { padding: 8px 14px; }
  .auth-area .auth-chip .rf { width: 22px; height: 22px; margin: 3px; }
  .nav-toggle { width: 38px; height: 38px; }
  .site-header .wrap { gap: 6px; }
}

/* ---------------------------------------------------------
   Уведомления: колокольчик в шапке и выпадающий список (notifications.js)
   --------------------------------------------------------- */
.nt { position: relative; flex: none; }
.nt-bell {
  position: relative;
  width: 38px; height: 38px;
  display: grid; place-items: center;
  padding: 0;
  cursor: pointer;
  color: var(--ink-muted);
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 50%;
  transition: color .25s ease, background-color .25s ease, border-color .25s ease, transform .5s var(--spring);
}
.nt-bell svg { width: 19px; height: 19px; transform-origin: 50% 8%; }
.nt-bell:hover, .nt.is-open .nt-bell { color: var(--gold-bright); border-color: var(--gold-dim); background: var(--gold-wash); transform: translateY(-1px); }
.nt-bell:focus-visible { outline: 2px solid rgba(var(--nav-rgb), 0.7); outline-offset: 2px; }
.nt-bell.has-new { color: var(--gold-bright); }
.nt-bell.is-ring svg { animation: nt-ring 1.1s cubic-bezier(.36,.07,.19,.97); }
@keyframes nt-ring { 0%, 100% { rotate: 0deg; } 15% { rotate: 16deg; } 30% { rotate: -14deg; } 45% { rotate: 10deg; } 60% { rotate: -7deg; } 75% { rotate: 3deg; } }
.nt-badge {
  position: absolute; top: -4px; right: -5px;
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px;
  font: 600 10.5px/18px var(--font-mono);
  letter-spacing: 0;
  text-align: center;
  color: #fff;
  background: linear-gradient(160deg, #ee7a6c, #d44a3d);
  box-shadow: 0 0 0 2px var(--void), 0 4px 10px -2px rgba(212,74,61,0.6);
}
.nt-badge[hidden] { display: none; }

.nt-panel {
  position: absolute; top: calc(100% + 14px); right: -6px; z-index: 60;
  width: min(400px, calc(100vw - 24px)); max-height: min(72vh, 560px);
  display: flex; flex-direction: column;
  background: rgba(16,16,19,0.97);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  border: 1px solid rgba(212,175,55,0.24);
  border-radius: 16px;
  box-shadow: 0 30px 70px -20px rgba(0,0,0,0.9), inset 0 1px 0 rgba(255,255,255,0.04);
  transform-origin: 90% 0;
  animation: nt-pop .32s var(--spring);
  text-transform: none; letter-spacing: 0;
  font-family: var(--font-body); font-size: 16px; text-align: left;
}
.nt-panel[hidden] { display: none; }
@keyframes nt-pop { from { opacity: 0; transform: translateY(-8px) scale(0.96); } to { opacity: 1; transform: none; } }
.nt-panel::before {
  content: ""; position: absolute; top: -6px; right: 20px; width: 12px; height: 12px;
  background: rgba(16,16,19,0.97); border-left: 1px solid rgba(212,175,55,0.24); border-top: 1px solid rgba(212,175,55,0.24);
  transform: rotate(45deg);
}
.nt-phead { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px 10px; border-bottom: 1px solid var(--hairline); }
.nt-ptitle { font-family: var(--font-display); font-size: 17px; color: var(--ink-parchment); }
.nt-all { padding: 4px 6px; cursor: pointer; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--gold-bright); background: none; border: 0; transition: opacity .2s ease; }
.nt-all:hover { text-decoration: underline; }
.nt-all:disabled { opacity: 0.35; cursor: default; text-decoration: none; }
.nt-list { overflow-y: auto; overscroll-behavior: contain; }
.nt-item { position: relative; display: flex; gap: 10px; padding: 12px 16px 12px 20px; border-bottom: 1px solid var(--hairline); text-decoration: none; color: inherit; transition: background-color .2s ease; }
.nt-item:last-child { border-bottom: 0; }
.nt-item:hover { background: rgba(255,255,255,0.045); }
.nt-item.is-new { background: rgba(212,175,55,0.06); }
.nt-item.is-new::before { content: ""; position: absolute; left: 7px; top: 50%; width: 6px; height: 6px; margin-top: -3px; border-radius: 50%; background: var(--gold-bright); box-shadow: 0 0 8px var(--gold-bright); }
.nt-av.rf { width: 32px; height: 32px; margin: 5px; flex: none; }
.nt-av.rf .rf-letter { font-size: 14px; }
.nt-av.rf::before { inset: -3px; }
.nt-body { min-width: 0; flex: 1; }
.nt-lab { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--gold); }
.nt-time { color: var(--ink-faint); text-transform: none; letter-spacing: 0; white-space: nowrap; }
.nt-who { display: block; max-width: 100%; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--font-display); font-size: 16px; font-weight: 600; }
.nt-ttl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; color: var(--ink-muted); }
.nt-snip { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: 3px; font-size: 15px; font-style: italic; line-height: 1.4; color: var(--ink-parchment); overflow-wrap: anywhere; }
.nt-empty { margin: 0; padding: 26px 18px; text-align: center; font-style: italic; color: var(--ink-faint); }

/* на узких экранах список раскрывается на всю ширину под шапкой */
@media (max-width: 780px) {
  .nt { position: static; }
  .nt-bell { width: 34px; height: 34px; }
  .nt-panel { position: fixed; left: 8px; right: 8px; top: calc(100% + 6px); width: auto; max-height: 70vh; }
  .nt-panel::before { display: none; }
}

/* ---------------------------------------------------------
   Auth forms & admin table
   --------------------------------------------------------- */

.auth-hero {
  padding: 76px 0 56px;
  border-bottom: 1px solid var(--hairline);
}
.auth-hero h1 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(30px, 4vw, 42px);
  margin: 18px 0 12px;
}
.auth-hero .lede { max-width: 60ch; font-size: 17px; color: var(--ink-muted); margin: 0; }

.auth-card {
  max-width: 420px;
  margin: 56px auto;
  border: 1px solid var(--card-border);
  background: linear-gradient(160deg, var(--card), var(--panel));
  border-radius: var(--radius);
  padding: 32px;
}
.auth-tabs { display: flex; gap: 6px; margin-bottom: 26px; border-bottom: 1px solid var(--hairline); }
.auth-tab {
  flex: 1;
  background: none;
  border: none;
  padding: 10px 0 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.auth-tab.active { color: var(--gold-bright); border-bottom-color: var(--gold); }

.auth-form { display: none; flex-direction: column; gap: 16px; }
.auth-form.active { display: flex; }
.auth-form label {
  display: block;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 6px;
}
.auth-form input {
  width: 100%;
  background: var(--void);
  border: 1px solid var(--card-border);
  color: var(--ink-parchment);
  font-family: var(--font-body);
  font-size: 16px;
  padding: 11px 14px;
  border-radius: var(--radius);
  box-sizing: border-box;
}
.auth-form input:focus { outline: none; border-color: var(--gold-dim); }
.auth-submit {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--void);
  background: linear-gradient(160deg, var(--gold-bright), var(--gold));
  border: none;
  padding: 13px 20px;
  border-radius: var(--radius);
  cursor: pointer;
  margin-top: 4px;
}
.auth-submit:hover { filter: brightness(1.08); }
.auth-submit:disabled { opacity: .6; cursor: default; }
.auth-divider {
  display: flex; align-items: center; gap: 12px;
  margin: 22px 0 16px;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink-faint);
}
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--hairline); }
.auth-google { width: 100%; margin-top: 0; }
.auth-message {
  font-family: var(--font-mono);
  font-size: 12.5px;
  padding: 10px 12px;
  border-radius: var(--radius);
  display: none;
}
.auth-message.is-error { display: block; color: #e08a8a; background: rgba(224,138,138,0.1); border: 1px solid rgba(224,138,138,0.3); }
.auth-message.is-success { display: block; color: var(--gold-bright); background: var(--gold-wash); border: 1px solid var(--gold-dim); }

.auth-signed-in { text-align: center; padding: 40px 0; }
.auth-signed-in p { color: var(--ink-muted); }

/* Admin table */
.admin-table-wrap { overflow-x: auto; margin-bottom: 60px; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.admin-table th {
  text-align: left;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
  padding: 10px 14px;
  border-bottom: 1px solid var(--hairline);
  white-space: nowrap;
}
.admin-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--hairline);
  color: var(--ink-parchment);
  white-space: nowrap;
}
.admin-table .role-badge {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--card-border);
  color: var(--ink-muted);
}
.admin-table .role-badge.is-admin { color: #e8626a; border-color: rgba(224,70,82,0.5); background: rgba(224,70,82,0.1); }
.admin-table .role-badge.is-super { color: var(--gold-bright); border-color: var(--gold); }
.admin-table button {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: transparent;
  border: 1px solid var(--card-border);
  color: var(--ink-muted);
  padding: 6px 12px;
  border-radius: var(--radius);
  cursor: pointer;
  margin-right: 6px;
}
.admin-table button:hover { color: var(--ink-parchment); border-color: var(--ink-muted); }
/* «Профиль» — ссылка, оформленная как кнопка; имя с аватаром тоже ведёт в профиль */
.admin-table .admin-btn {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid rgba(212,175,55,0.4);
  color: var(--gold-bright);
  padding: 6px 12px;
  border-radius: var(--radius);
  margin-right: 6px;
  text-decoration: none;
  transition: background-color .2s ease, border-color .2s ease;
}
.admin-table .admin-btn:hover { background: var(--gold-wash); border-color: var(--gold); }
.admin-table .admin-user { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
.admin-table .admin-user:hover .rn { text-decoration: underline; }
.admin-table .admin-user .rf { width: 26px; height: 26px; margin: 4px; flex: none; }
.admin-table .admin-user .rf .rf-letter { font-size: 12px; }
.admin-table .admin-user .rf::before { inset: -3px; }
.admin-table button.danger { color: #e08a8a; border-color: rgba(224,138,138,0.35); }
.admin-table button.danger:hover { background: rgba(224,138,138,0.1); border-color: #e08a8a; }
.admin-table button:disabled { opacity: .4; cursor: default; }
.admin-table select {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  background: var(--void);
  border: 1px solid var(--card-border);
  color: var(--ink-parchment);
  padding: 6px 8px;
  border-radius: var(--radius);
  margin-right: 6px;
  cursor: pointer;
}
.admin-table select:disabled { opacity: .4; cursor: default; }

/* ---------------------------------------------------------
   Роли: эффект имени (.rn) и рамки аватара (.rf).
   Класс роли: role-worker / role-otherworldly / role-tarot / role-moderator / role-super.
   Пример: <span class="rf role-tarot"><span class="rf-letter">К</span></span> и <span class="rn role-tarot">Имя</span>
   --------------------------------------------------------- */
.rn { display: inline-block; }
.auth-area a.auth-name { text-decoration: none; }
.auth-area a.auth-name:hover { text-decoration: underline; }
.rf {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 64px; height: 64px;
  border-radius: 50%;
  flex: 0 0 auto;
  isolation: isolate;
  background: var(--void);
}
.rf img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.rf .rf-letter { font-family: var(--font-display); font-size: 26px; color: var(--ink-parchment); }
.rf::before, .rf::after { content: ""; position: absolute; border-radius: 50%; pointer-events: none; }
.rf::before { inset: -5px; z-index: -1; }
.rf::after { inset: 0; }

/* Рабочий класс — простой тёплый песочный оттенок, не серый */
.rn.role-worker { color: #b8a98f; }
.rf.role-worker::before { border: 1px solid #7d705b; }

/* Потусторонний — слегка фиолетовое, тусклая подсветка */
.rn.role-otherworldly { color: #b8a0dc; text-shadow: 0 0 8px rgba(140,108,200,0.35); }
.rf.role-otherworldly::before {
  border: 1px solid #7a5fa6;
  box-shadow: 0 0 12px rgba(122,95,166,0.38), inset 0 0 8px rgba(122,95,166,0.22);
  animation: role-breathe 6s ease-in-out infinite;
}
@keyframes role-breathe { 0%, 100% { opacity: .65; } 50% { opacity: 1; } }

/* Участник Клуба таро — вращающееся золото-фиолетовое кольцо, переливающееся имя */
.rn.role-tarot {
  background: linear-gradient(100deg, #b8925a 0%, #f2dfae 30%, #9a7fd0 52%, #f2dfae 74%, #b8925a 100%);
  background-size: 260% 100%;
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 5px rgba(201,169,106,0.3));
  animation: tarot-shimmer 8s ease-in-out infinite;
}
@keyframes tarot-shimmer { 0%, 100% { background-position: 100% 0; } 50% { background-position: 0 0; } }
.rf.role-tarot::before {
  inset: -5px;
  background: conic-gradient(#c9a96a, #6b4fa0, #2c3f80, #c9a96a, #6b4fa0, #c9a96a);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 2.5px), #000 calc(100% - 2px));
          mask: radial-gradient(farthest-side, transparent calc(100% - 2.5px), #000 calc(100% - 2px));
  filter: drop-shadow(0 0 6px rgba(160,130,210,0.45));
  animation: role-spin 12s linear infinite;
}
@keyframes role-spin { to { transform: rotate(360deg); } }

/* Повелитель тайн — красная руническая дуга, мягкая пульсация свечения */
.rn.role-moderator {
  color: #e8626a;
  animation: mod-glow 4.5s ease-in-out infinite;
}
@keyframes mod-glow {
  0%, 100% { text-shadow: 0 0 6px rgba(220,60,70,0.25); }
  50%      { text-shadow: 0 0 14px rgba(160,128,215,0.55), 0 0 3px rgba(230,80,90,0.55); }
}
.rf.role-moderator::before {
  inset: -7px;
  background: conic-gradient(transparent 0 18%, #e04652 24%, transparent 30% 56%, #a487dc 62%, transparent 68% 100%);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 2.5px), #000 calc(100% - 2px));
          mask: radial-gradient(farthest-side, transparent calc(100% - 2.5px), #000 calc(100% - 2px));
  filter: drop-shadow(0 0 5px rgba(224,70,82,0.6));
  animation: role-spin-rev 9s linear infinite;
}
.rf.role-moderator::after {
  box-shadow: 0 0 0 2px rgba(224,70,82,0.55), 0 0 16px rgba(164,135,220,0.35);
  animation: role-breathe 4.5s ease-in-out infinite;
}
@keyframes role-spin-rev { to { transform: rotate(-360deg); } }

/* Серый Туман (главная роль): клубится над аватаром и стелется вокруг, имя тонет в дымке */
.rn.role-super {
  background: linear-gradient(100deg, #6a6a74 0%, #ececf4 30%, #8e8e9a 50%, #f4f4fa 72%, #666670 100%);
  background-size: 280% 100%;
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 7px rgba(205,205,220,0.45)) drop-shadow(0 0 18px rgba(150,150,170,0.3));
  animation: tarot-shimmer 11s ease-in-out infinite;
}
.rf.role-super { background: #101013; }
.rf.role-super .rf-letter { position: relative; z-index: 2; text-shadow: 0 0 8px rgba(0,0,0,0.7); }
.rf.role-super::before {
  inset: -9px;
  background:
    radial-gradient(circle at 25% 30%, rgba(190,190,206,0.3), transparent 55%),
    radial-gradient(circle at 78% 70%, rgba(140,140,158,0.28), transparent 58%),
    radial-gradient(circle at 50% 100%, rgba(215,215,230,0.18), transparent 50%);
  background-size: 160% 160%;
  filter: blur(7px);
  animation: fog-drift 12s ease-in-out infinite alternate;
}
.rf.role-super::after {
  z-index: 1;
  background:
    radial-gradient(ellipse at 30% 35%, rgba(205,205,220,0.38), transparent 58%),
    radial-gradient(ellipse at 74% 66%, rgba(150,150,168,0.3), transparent 60%),
    radial-gradient(ellipse at 45% 92%, rgba(225,225,238,0.2), transparent 52%);
  background-size: 190% 190%;
  filter: blur(3px);
  mix-blend-mode: screen;
  box-shadow: inset 0 0 0 1px rgba(200,200,214,0.3), inset 0 0 12px rgba(0,0,0,0.6);
  animation: fog-drift 9s ease-in-out infinite alternate-reverse;
}
@keyframes fog-drift {
  from { background-position: 0% 0%, 100% 50%, 40% 100%; }
  to   { background-position: 100% 60%, 0% 20%, 70% 0%; }
}

@media (prefers-reduced-motion: reduce) {
  .rn, .rf::before, .rf::after { animation: none !important; }
}

/* ---------------------------------------------------------
   Footer
   --------------------------------------------------------- */

.site-footer {
  border-top: 1px solid var(--hairline);
  padding: 36px 0 60px;
  margin-top: 100px;
}
.site-footer .wrap {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 12px;
}
.site-footer p {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--ink-faint);
  margin: 0;
}

/* ---------------------------------------------------------
   Buttons / small components
   --------------------------------------------------------- */

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold-bright);
  background: transparent;
  border: 1px solid var(--gold-dim);
  padding: 10px 18px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background .2s ease, color .2s ease, border-color .2s ease;
}
.btn-ghost:hover { background: var(--gold-wash); }

.tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 3px 9px;
  border: 1px solid var(--card-border);
  border-radius: 999px;
  color: var(--ink-muted);
  transition: border-color .2s ease, color .2s ease;
}

/* ---------------------------------------------------------
   Motion — плавные переходы и лёгкое появление контента
   --------------------------------------------------------- */

a, button, input, textarea, select,
.tag, .btn-ghost, .btn-reset,
.path-card, .item-card, .sheet-card, .attr-box, .derived-box, .status-box {
  transition: background-color .25s ease, border-color .25s ease,
              color .25s ease, transform .25s ease, box-shadow .25s ease,
              opacity .25s ease;
}

.item-card:hover {
  border-color: var(--gold-dim);
  transform: translateY(-3px);
}

/* Раньше блоки страницы при каждой загрузке сначала исчезали и выезжали снизу (fadeInUp) —
   при переходах по меню казалось, что страница мигает. Убрано: содержимое сразу на месте. */

/* ---------------------------------------------------------
   Atmosphere — туман и частицы в hero-блоках
   --------------------------------------------------------- */

/* isolation: фон-видео, туман и свечение внутри героя лежат на z-index < 0 и должны оставаться ВНУТРИ героя.
   Раньше слой создавала анимация появления (fadeInUp); когда её убрали, они уехали под фон страницы и пропали. */
.hero, .path-hero, .items-hero, .sheet-hero {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}
.path-card, .item-card, .sheet-card { isolation: isolate; }

.atmo {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: -1;
}

.atmo::before, .atmo::after {
  content: "";
  position: absolute;
  left: 0; right: 0;
  height: 30%;
  z-index: 2;
}
.atmo::before { top: 0;    background: linear-gradient(to bottom, var(--void) 0%, transparent 100%); }
.atmo::after  { bottom: 0; background: linear-gradient(to top,    var(--void) 0%, transparent 100%); }

.atmo .fog {
  position: absolute;
  top: 50%;
  border-radius: 45% 55% 50% 50% / 55% 45% 55% 45%;
  background:
    radial-gradient(ellipse 55% 60% at 32% 38%, rgba(205,205,212,0.20), transparent 70%),
    radial-gradient(ellipse 50% 55% at 68% 55%, rgba(205,205,212,0.16), transparent 72%),
    radial-gradient(ellipse 45% 50% at 48% 70%, rgba(205,205,212,0.13), transparent 70%);
  filter: blur(60px);
  mix-blend-mode: screen;
  will-change: transform;
}

.atmo .fog-a {
  width: 78vw; min-width: 560px; max-width: 980px;
  height: 60%;
  left: -20%; margin-top: -30%;
  filter: blur(70px);
  animation: fogDriftA 26s ease-in-out infinite;
}
.atmo .fog-b {
  width: 62vw; min-width: 460px; max-width: 820px;
  height: 55%;
  left: 30%; margin-top: -18%;
  filter: blur(58px);
  opacity: .85;
  animation: fogDriftB 32s ease-in-out infinite;
}
.atmo .fog-c {
  width: 50vw; min-width: 380px; max-width: 660px;
  height: 50%;
  left: 4%; margin-top: 6%;
  filter: blur(50px);
  opacity: .65;
  animation: fogDriftC 38s ease-in-out infinite;
}

@keyframes fogDriftA {
  0%, 100% { transform: translate(-4vw, 0) scale(1); }
  50%      { transform: translate(9vw, 2.5vh) scale(1.14); }
}
@keyframes fogDriftB {
  0%, 100% { transform: translate(3vw, 1vh) scale(1); }
  50%      { transform: translate(-10vw, -2vh) scale(1.1); }
}
@keyframes fogDriftC {
  0%, 100% { transform: translate(-3vw, 1.5vh) scale(0.94); }
  50%      { transform: translate(7vw, -2vh) scale(1.06); }
}

.atmo .spark {
  position: absolute;
  bottom: 4%;
  left: var(--x, 50%);
  width: var(--size, 3px);
  height: var(--size, 3px);
  border-radius: 50%;
  background: var(--gold-bright);
  box-shadow: 0 0 7px 2px rgba(227,197,131,0.75);
  opacity: 0;
  animation: sparkRise var(--dur, 12s) linear infinite;
  animation-delay: var(--delay, 0s);
}

@keyframes sparkRise {
  0%   { transform: translate(0, 0); opacity: 0; }
  15%  { opacity: 1; }
  80%  { opacity: .45; }
  100% { transform: translate(var(--drift, 18px), -300px); opacity: 0; }
}

.atmo .spark:nth-child(4)  { --x: 6%;  --size: 2.5px; --dur: 10s; --delay: 0s;  --drift: 26px; }
.atmo .spark:nth-child(5)  { --x: 14%; --size: 3.5px; --dur: 14s; --delay: 2s;  --drift: -30px; }
.atmo .spark:nth-child(6)  { --x: 22%; --size: 2.5px; --dur: 12s; --delay: 5s;  --drift: 18px; }
.atmo .spark:nth-child(7)  { --x: 31%; --size: 3px;   --dur: 16s; --delay: 1s;  --drift: -22px; }
.atmo .spark:nth-child(8)  { --x: 40%; --size: 2.5px; --dur: 11s; --delay: 7s;  --drift: 34px; }
.atmo .spark:nth-child(9)  { --x: 49%; --size: 3.5px; --dur: 15s; --delay: 3s;  --drift: -26px; }
.atmo .spark:nth-child(10) { --x: 58%; --size: 2.5px; --dur: 13s; --delay: 6s;  --drift: 20px; }
.atmo .spark:nth-child(11) { --x: 67%; --size: 3px;   --dur: 17s; --delay: 0.5s; --drift: -32px; }
.atmo .spark:nth-child(12) { --x: 75%; --size: 2.5px; --dur: 10s; --delay: 4s;  --drift: 24px; }
.atmo .spark:nth-child(13) { --x: 83%; --size: 3.5px; --dur: 14s; --delay: 8s;  --drift: -18px; }
.atmo .spark:nth-child(14) { --x: 90%; --size: 2.5px; --dur: 12s; --delay: 2.5s; --drift: 22px; }
.atmo .spark:nth-child(15) { --x: 97%; --size: 3px;   --dur: 16s; --delay: 5.5s; --drift: -24px; }

@media (max-width: 700px) {
  .atmo .fog { filter: blur(40px); }
  .atmo .fog-c { display: none; }
}

.paths-grid .path-card:nth-child(1) { animation-delay: .03s; }
.paths-grid .path-card:nth-child(2) { animation-delay: .07s; }
.paths-grid .path-card:nth-child(3) { animation-delay: .11s; }
.paths-grid .path-card:nth-child(4) { animation-delay: .15s; }
.paths-grid .path-card:nth-child(5) { animation-delay: .19s; }
.paths-grid .path-card:nth-child(6) { animation-delay: .23s; }

.items-grid .item-card:nth-child(1) { animation-delay: .03s; }
.items-grid .item-card:nth-child(2) { animation-delay: .06s; }
.items-grid .item-card:nth-child(3) { animation-delay: .09s; }
.items-grid .item-card:nth-child(4) { animation-delay: .12s; }
.items-grid .item-card:nth-child(5) { animation-delay: .15s; }
.items-grid .item-card:nth-child(6) { animation-delay: .18s; }
.items-grid .item-card:nth-child(7) { animation-delay: .21s; }
.items-grid .item-card:nth-child(8) { animation-delay: .24s; }

#sheet .sheet-card:nth-child(1) { animation-delay: .03s; }
#sheet .sheet-card:nth-child(2) { animation-delay: .08s; }
#sheet .sheet-card:nth-child(3) { animation-delay: .13s; }
#sheet .sheet-card:nth-child(4) { animation-delay: .18s; }
#sheet .sheet-card:nth-child(5) { animation-delay: .23s; }
#sheet .sheet-card:nth-child(6) { animation-delay: .28s; }
#sheet .sheet-card:nth-child(7) { animation-delay: .33s; }

/* ---------------------------------------------------------
   Sequence gate — выбор текущей Последовательности персонажа,
   открывающий соответствующие ступени Пути (используется на
   всех страницах Путей вместе с path-gate.js)
   --------------------------------------------------------- */

.seq-gate {
  border: 1px solid var(--card-border);
  background: linear-gradient(160deg, var(--card), var(--panel));
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 24px;
}
.seq-gate-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0 0 8px;
}
.seq-gate select {
  width: 100%;
  background: var(--void);
  border: 1px solid var(--card-border);
  color: var(--ink-parchment);
  font-family: var(--font-body);
  font-size: 15px;
  padding: 9px 10px;
  border-radius: var(--radius);
}
.seq-gate select:focus { outline: none; border-color: var(--gold-dim); }
.seq-gate-hint {
  font-size: 12.5px;
  color: var(--ink-faint);
  margin: 8px 0 0;
  line-height: 1.4;
}

.ladder li.is-gate-locked a {
  color: var(--ink-faint) !important;
  opacity: .5;
  pointer-events: none;
  cursor: default;
}
.ladder li.is-gate-locked .num { color: var(--ink-faint) !important; }

.seq-gate-locked-notice {
  margin-top: 40px;
  padding: 26px 30px;
  text-align: center;
  border: 1px dashed var(--card-border);
  border-radius: var(--radius);
  color: var(--ink-faint);
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.03em;
  line-height: 1.6;
}

/* Десять пунктов меню: на средних экранах делаем шапку компактнее, чтобы пункты не переносились;
   ниже 1260px меню прячется за кнопкой-бургером (правила бургера — в блоке max-width: 1260px выше). */
.site-nav a { white-space: nowrap; }
@media (min-width: 1261px) {
  .brand { flex-shrink: 0; }
  .brand .word b { white-space: nowrap; }
}
@media (max-width: 1820px) and (min-width: 1501px) {
  .site-header .wrap { gap: 12px; }
  .site-nav { font-size: 12.5px; letter-spacing: 0.04em; }
  .site-nav a { padding: 8px 9px; }
  .brand .word small { display: none; }
  .auth-area .auth-name { max-width: 90px; }
}
@media (max-width: 1500px) and (min-width: 1261px) {
  .site-nav { font-size: 11.5px; letter-spacing: 0.02em; padding: 3px; }
  .site-nav a { padding: 8px 6px; }
  .site-nav a:nth-child(7), .site-nav a:nth-child(10) { margin-left: 8px; }
  .site-nav a:nth-child(7)::before, .site-nav a:nth-child(10)::before { left: -5px; }
  .site-header .wrap { padding-left: 24px; padding-right: 24px; }
  .brand .word b { font-size: 16px; }
  .brand .word small { display: none; }
  .auth-area { gap: 2px; padding-left: 8px; margin-left: 0; }
  .auth-area .auth-link { padding: 7px 9px; }
  .auth-area .auth-name { max-width: 56px; }
}

/* Колокольчик уведомлений добавил ширины: подгоняем шапку. Ноутбуки до 1660px — только аватар (ник виден в подсказке),
   на телефонах скрываем надпись логотипа, если рядом колокольчик (остаётся значок). */
@media (max-width: 1820px) and (min-width: 1501px) {
  .nt-bell { width: 34px; height: 34px; }
  .auth-area .auth-name { max-width: 72px; }
}
@media (max-width: 1500px) and (min-width: 1261px) {
  .nt-bell { width: 32px; height: 32px; }
  .nt-bell svg { width: 17px; height: 17px; }
}
@media (max-width: 1660px) and (min-width: 1261px) {
  .auth-area .auth-name { display: none; }
  .auth-area .auth-chip { padding: 0; }
}
@media (max-width: 480px) {
  .site-header .wrap:has(.nt) .brand .word { display: none; }
}

/* =========================================================
   Переключатель миров (Повелитель тайн ⇄ Аберус).
   Кнопку и меню вставляет nav.js рядом с названием сайта.
   ========================================================= */
.site-header.has-worlds .brand { margin-right: 0; }
.world-switch { position: relative; margin-right: auto; flex-shrink: 0; }
.world-btn {
  display: flex; align-items: center; gap: 8px;
  height: 36px; padding: 0 12px 0 6px;
  border: 1px solid var(--card-border); border-radius: 999px;
  background: rgba(255,255,255,0.02); color: var(--ink-muted);
  font: 500 12px/1 var(--font-mono); letter-spacing: .08em; text-transform: uppercase;
  cursor: pointer;
  transition: border-color .3s ease, color .3s ease, background-color .3s ease, transform .5s var(--spring);
}
.world-btn:hover, .world-btn[aria-expanded="true"] { border-color: var(--gold-dim); color: var(--gold-bright); background: var(--gold-wash); }
.world-btn:active { transform: scale(.96); }
.world-btn .wb-coins { position: relative; width: 40px; height: 26px; flex: none; }
.world-btn .wb-coins img { position: absolute; left: 0; top: 0; width: 26px; height: 26px; object-fit: contain; border-radius: 50%;
  transition: transform .7s var(--spring), opacity .4s ease; }
.world-btn .wb-coins .lotm { display: grid; place-items: center; position: absolute; left: 0; top: 0; width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--gold-dim); color: var(--gold); background: var(--panel); transition: transform .7s var(--spring), opacity .4s ease; }
.world-btn .wb-coins .lotm svg { width: 16px; height: 12px; }
.world-btn .wb-coins img { transform: translateX(10px) scale(.7); opacity: .55; }
.world-btn:hover .wb-coins .lotm { transform: translateX(-6px) rotate(-12deg); }
.world-btn:hover .wb-coins img { transform: translateX(14px) scale(.85) rotate(20deg); opacity: 1; }
.world-btn .chev { width: 8px; height: 8px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg) translateY(-2px); margin-left: 10px; transition: transform .4s var(--spring); }
.world-btn[aria-expanded="true"] .chev { transform: rotate(225deg) translate(-2px, 0); }
.world-menu {
  position: absolute; left: 0; top: calc(100% + 12px); z-index: 60; width: 320px;
  padding: 8px; border: 1px solid var(--card-border); border-radius: 14px;
  background: rgba(24,24,28,0.97); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  box-shadow: 0 30px 60px -24px rgba(0,0,0,0.9), 0 0 0 1px rgba(212,175,55,0.06);
  transform-origin: 30px 0; animation: world-pop .45s var(--spring);
}
.world-menu[hidden] { display: none; }
@keyframes world-pop { from { opacity: 0; transform: translateY(-8px) scale(.94); } }
.world-menu .wm-title { font: 500 11px var(--font-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-faint); padding: 6px 10px 8px; }
.world-item {
  display: grid; grid-template-columns: 44px 1fr auto; gap: 12px; align-items: center;
  padding: 10px; border-radius: 10px; text-decoration: none; color: var(--ink-parchment);
  animation: world-item .5s var(--spring) both; animation-delay: calc(var(--i, 0) * 70ms + 80ms);
  transition: background-color .25s ease;
}
@keyframes world-item { from { opacity: 0; transform: translateX(-10px); } }
.world-item:hover, .world-item:focus-visible { background: rgba(255,255,255,0.04); }
.world-item .wi-ico { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; overflow: hidden; border: 1px solid var(--card-border); background: var(--panel-2); color: var(--gold); }
.world-item .wi-ico img { width: 100%; height: 100%; object-fit: contain; transition: transform .8s var(--spring); }
.world-item:hover .wi-ico img { transform: rotateY(360deg); }
.world-item .wi-ico svg { width: 24px; height: 18px; }
.world-item b { display: block; font: 600 15px var(--font-display); letter-spacing: .06em; color: var(--gold-bright); }
.world-item small { display: block; font-size: 13px; color: var(--ink-muted); margin-top: 2px; }
.world-item .wi-tag { font: 500 10px var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--gold); border: 1px solid var(--gold-dim); border-radius: 999px; padding: 3px 8px; }
.world-item .wi-go { color: var(--ink-faint); transition: transform .4s var(--spring), color .3s ease; }
.world-item:hover .wi-go { color: var(--gold-bright); transform: translateX(4px); }
/* переход между мирами: монета Аберуса переворачивается во весь экран */
.world-veil { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; background: radial-gradient(circle at 50% 50%, #2a1213, #0d0708 70%); opacity: 0; animation: world-veil .55s ease forwards; pointer-events: all; }
.world-veil img { width: 120px; height: 120px; object-fit: contain; filter: drop-shadow(0 0 30px rgba(242,150,60,.55)); animation: world-coin .9s cubic-bezier(.3,.7,.2,1) forwards; }
@keyframes world-veil { to { opacity: 1; } }
@keyframes world-coin { from { transform: perspective(400px) rotateY(-540deg) scale(.3); opacity: 0; } to { transform: perspective(400px) rotateY(0) scale(1); opacity: 1; } }
@media (max-width: 1260px) {
  .world-btn .wb-name { display: none; }
  .world-btn { padding-right: 8px; }
  .world-btn .chev { margin-left: 8px; }
}
@media (max-width: 520px) {
  .brand .word small { display: none; }
  .world-menu { position: fixed; left: 12px; right: 12px; width: auto; top: 70px; }
}
@media (prefers-reduced-motion: reduce) {
  .world-menu, .world-item, .world-veil, .world-veil img { animation: none; opacity: 1; }
}

/* ---------- эмблема «Повелителя тайн» в шапке (как монета у Аберуса) ---------- */
.brand .emblem { display: block; width: 40px; height: 40px; flex: none; perspective: 300px; }
.brand .emblem img { width: 100%; height: 100%; object-fit: contain; display: block;
  filter: drop-shadow(0 0 7px rgba(214,226,255,.28)) drop-shadow(0 2px 3px rgba(0,0,0,.5));
  animation: emblem-in 1.6s cubic-bezier(.16,1,.3,1) .2s both; transition: filter .4s ease; }
.brand:hover .emblem img, .brand:focus-visible .emblem img {
  animation: emblem-flip 1.1s cubic-bezier(.16,1,.3,1);
  filter: drop-shadow(0 0 12px rgba(227,197,131,.55)) drop-shadow(0 2px 3px rgba(0,0,0,.5)); }
@keyframes emblem-in { from { opacity: 0; transform: scale(.6) rotate(-20deg); } }
@keyframes emblem-flip { from { transform: rotateY(0); } to { transform: rotateY(360deg); } }
@media (prefers-reduced-motion: reduce) { .brand .emblem img { animation: none !important; } }
/* эмблема в переключателе миров */
.world-btn .wb-coins .lotm img { width: 100%; height: 100%; object-fit: contain; border-radius: 50%; }
.world-btn .wb-coins .lotm:has(img) { border: 0; background: none; }
.world-item .wi-ico img.lotm-em { width: 86%; height: 86%; }
.world-veil.to-lotm .lotm-em { width: 140px; height: 140px; object-fit: contain; filter: drop-shadow(0 0 30px rgba(214,226,255,.4)); animation: world-coin .9s cubic-bezier(.3,.7,.2,1) forwards; }
