/* Гостиная Сайреса: обстановка.
   Не кирпич и не камень, а тёплое дерево стенных панелей, плотная ткань под чатом и медь.
   Центр сцены справа: большой очаг-жаровня, из огня поднимается феникс, вверх летят искры.
   Всё, что движется, замирает при prefers-reduced-motion и в «спокойной обстановке». */

/* ---------- Стены, ткань, медь ---------- */

.sidenav,
.online {
  background:
    linear-gradient(180deg, rgba(27, 15, 14, 0.30), rgba(27, 15, 14, 0.55)),
    url("img/wood.svg") 0 0 / 180px 320px repeat,
    var(--panel);
  border-color: var(--metal-line);
}

/* чат обит тканью, по краю медная кромка с заклёпками в углах */
.panel {
  background:
    radial-gradient(circle at 10px 10px, var(--copper) 2.5px, transparent 3.5px),
    radial-gradient(circle at calc(100% - 10px) 10px, var(--copper) 2.5px, transparent 3.5px),
    radial-gradient(circle at 10px calc(100% - 10px), var(--copper) 2.5px, transparent 3.5px),
    radial-gradient(circle at calc(100% - 10px) calc(100% - 10px), var(--copper) 2.5px, transparent 3.5px),
    url("img/fabric.svg") 0 0 / 10px 10px repeat,
    var(--panel);
  border-color: var(--metal-line);
}

/* меню компактнее: пункты ниже, иконки в медных кружках */
.sidenav { padding: 10px 8px; }
.sidenav__link { min-height: 42px; gap: 10px; padding: 0 10px; font-weight: 700; }
.sidenav__link svg {
  width: 28px; height: 28px; padding: 5px;
  border-radius: 50%;
  border: 1px solid var(--metal-line);
  color: var(--flame);
  background: rgba(27, 15, 14, 0.5);
}
.sidenav__link[aria-current="page"] { box-shadow: inset 3px 0 0 var(--ember); }
.sidenav__link[aria-current="page"] svg { background: var(--ember); color: var(--ash); border-color: var(--ember); }

.brand__title { font-weight: 700; }
.brand__crest { background: var(--coal); }
.brand__motto { color: var(--gold); }

.panel__title { letter-spacing: .01em; }
.day { color: var(--gold); }

/* свои сообщения: тёплая подсветка без красной заливки */
.msg--mine { box-shadow: inset 3px 0 0 rgba(255, 193, 90, 0.45); }
.msg--mention { box-shadow: inset 3px 0 0 var(--rose); }

/* ---------- Гирлянда флажков над чатом ---------- */

.garland {
  flex: none;
  height: 46px;
  margin-top: -2px;
  background:
    url("../imgs/flags.png") center top / auto 46px repeat-x;
  transform-origin: 50% 0;
  animation: garland-sway 9s ease-in-out infinite;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}
@keyframes garland-sway {
  0%, 100% { transform: rotate(0) translateY(0); }
  50%      { transform: rotate(.25deg) translateY(1px); }
}
.chat .panel__head { padding-top: 6px; }

/* ---------- Приветствие ---------- */

.chat .greeting { font-style: italic; }
@media (max-width: 767px) {
  .chat .greeting { display: block; margin-top: 4px; font-size: .86rem; }
  .garland { height: 34px; background-size: auto 34px; }
}

/* ---------- Очаг ----------
   Ниша в деревянной стене, в ней медная чаша на трёх ножках. Пламя из трёх слоёв
   (роза снаружи, огонь, золото внутри), из огня поднимается феникс с герба. */

.hearth {
  position: relative;
  margin: 0 0 14px;
}
.hearth__niche {
  position: relative;
  height: 248px;
  border-radius: 120px 120px 14px 14px;
  overflow: hidden;
  background:
    radial-gradient(ellipse 70% 55% at 50% 78%, rgba(255, 122, 47, 0.30), transparent 70%),
    linear-gradient(180deg, #120807, #1d0d0b 60%, #2a1410);
  box-shadow:
    inset 0 0 0 2px var(--metal-line),
    inset 0 0 0 6px rgba(27, 15, 14, 0.9),
    inset 0 0 0 7px rgba(194, 122, 74, 0.35),
    inset 0 -30px 60px -20px rgba(255, 122, 47, 0.35),
    0 12px 28px -16px rgba(0, 0, 0, 0.9);
}

/* живой отсвет огня: пятно дышит */
.hearth__glow {
  position: absolute; left: 50%; bottom: 40px;
  width: 240px; height: 200px; margin-left: -120px;
  background: radial-gradient(ellipse at 50% 70%, rgba(255, 193, 90, 0.42), rgba(255, 122, 47, 0.18) 40%, transparent 70%);
  animation: hearth-glow 3.2s ease-in-out infinite;
}
@keyframes hearth-glow {
  0%, 100% { opacity: .75; transform: scale(1); }
  40%      { opacity: 1;   transform: scale(1.06); }
  70%      { opacity: .85; transform: scale(.98); }
}

/* феникс поднимается из огня */
.hearth__phoenix {
  position: absolute; left: 50%; top: 16px;
  width: 150px; height: 150px; margin-left: -75px;
  opacity: .9;
  filter: drop-shadow(0 0 14px rgba(255, 122, 47, 0.65)) drop-shadow(0 0 30px rgba(232, 67, 42, 0.35));
  animation: phoenix-rise 6s ease-in-out infinite;
}
@keyframes phoenix-rise {
  0%, 100% { transform: translateY(4px) scale(.97); }
  50%      { transform: translateY(-6px) scale(1.02); }
}

/* пламя */
.hearth__fire {
  position: absolute; left: 50%; bottom: 52px;
  width: 190px; height: 132px; margin-left: -95px;
  overflow: visible;
}
.flame { transform-box: fill-box; transform-origin: 50% 100%; }
.flame path { stroke: none; }
.flame--back path { fill: var(--rose); opacity: .85; }
.flame--mid path  { fill: var(--ember); }
.flame--core path { fill: var(--gold); }
.flame--back { animation: flame-a calc(2.3s * var(--flick, 1)) ease-in-out infinite; }
.flame--mid  { animation: flame-b calc(1.7s * var(--flick, 1)) ease-in-out infinite; }
.flame--core { animation: flame-c calc(1.3s * var(--flick, 1)) ease-in-out infinite; }
@keyframes flame-a {
  0%, 100% { transform: scale(1, 1) skewX(0); }
  30%      { transform: scale(1.03, 1.08) skewX(-2deg); }
  65%      { transform: scale(.98, .94) skewX(2deg); }
}
@keyframes flame-b {
  0%, 100% { transform: scale(1, 1) skewX(0); }
  25%      { transform: scale(.97, 1.1) skewX(3deg); }
  60%      { transform: scale(1.03, .95) skewX(-2deg); }
}
@keyframes flame-c {
  0%, 100% { transform: scale(1, 1); }
  40%      { transform: scale(1.06, 1.14); }
  75%      { transform: scale(.95, .92); }
}

/* искры */
.hearth__sparks { position: absolute; inset: 0; pointer-events: none; }
.spark {
  position: absolute; bottom: 92px; left: 50%;
  width: 4px; height: 4px; border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 6px 1px rgba(255, 193, 90, 0.9);
  opacity: 0;
  animation: spark-up 3.4s linear infinite;
}
.spark--1  { left: 42%; animation-delay: 0s;    animation-duration: 3.1s; }
.spark--2  { left: 55%; animation-delay: .5s;   animation-duration: 3.8s; }
.spark--3  { left: 47%; animation-delay: 1.1s;  animation-duration: 2.9s; width: 3px; height: 3px; }
.spark--4  { left: 60%; animation-delay: 1.7s;  animation-duration: 3.5s; }
.spark--5  { left: 38%; animation-delay: 2.2s;  animation-duration: 4.1s; width: 3px; height: 3px; }
.spark--6  { left: 52%; animation-delay: 2.8s;  animation-duration: 3.2s; }
.spark--7  { left: 45%; animation-delay: .9s;   animation-duration: 4.4s; width: 2px; height: 2px; }
.spark--8  { left: 58%; animation-delay: 3.3s;  animation-duration: 3s; }
.spark--9  { left: 50%; animation-delay: 1.4s;  animation-duration: 3.7s; width: 3px; height: 3px; }
.spark--10 { left: 41%; animation-delay: 3.9s;  animation-duration: 3.3s; }
.spark--11 { left: 63%; animation-delay: 2.5s;  animation-duration: 4s; width: 2px; height: 2px; }
.spark--12 { left: 35%; animation-delay: 4.4s;  animation-duration: 3.6s; width: 2px; height: 2px; }
.spark:nth-child(odd)  { --drift: 18px; }
.spark:nth-child(even) { --drift: -16px; }
@keyframes spark-up {
  0%   { opacity: 0; transform: translate(0, 0); }
  10%  { opacity: 1; }
  70%  { opacity: .8; }
  100% { opacity: 0; transform: translate(var(--drift, 10px), -170px); }
}

/* медная чаша с углями */
.hearth__bowl {
  position: absolute; left: 50%; bottom: 26px;
  width: 196px; height: 40px; margin-left: -98px;
  border-radius: 0 0 98px 98px / 0 0 40px 40px;
  background: linear-gradient(180deg, #d08a55, #a35a2c 45%, #6e3518);
  box-shadow: inset 0 -6px 10px rgba(0, 0, 0, 0.45), 0 6px 14px -6px rgba(0, 0, 0, 0.9);
}
.hearth__rim {
  position: absolute; left: -6px; right: -6px; top: -5px; height: 10px;
  border-radius: 6px;
  background: linear-gradient(180deg, #f0b07a, #c27a4a 50%, #8a4a22);
  box-shadow: 0 2px 3px rgba(0, 0, 0, 0.5);
}
.hearth__coals {
  position: absolute; left: 14px; right: 14px; top: -12px; height: 14px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 20% 60%, #ffc15a 0 3px, transparent 4px),
    radial-gradient(circle at 45% 40%, #ff7a2f 0 4px, transparent 5px),
    radial-gradient(circle at 70% 65%, #ffc15a 0 3px, transparent 4px),
    radial-gradient(circle at 85% 45%, #e8432a 0 4px, transparent 5px),
    radial-gradient(ellipse at 50% 60%, #7a2010, #2b0d08 75%);
  animation: coals 2.6s ease-in-out infinite;
}
@keyframes coals { 50% { filter: brightness(1.25); } }
.hearth__band {
  position: absolute; left: 22%; right: 22%; top: 16px; height: 3px;
  border-radius: 2px; background: rgba(255, 193, 90, 0.35);
}
.hearth__legs {
  position: absolute; left: 50%; bottom: 0;
  width: 150px; height: 28px; margin-left: -75px;
  display: flex; justify-content: space-between; align-items: flex-end;
}
.hearth__legs span {
  width: 8px; height: 28px;
  border-radius: 3px 3px 4px 4px;
  background: linear-gradient(90deg, #6e3518, #c27a4a, #6e3518);
}
.hearth__legs span:nth-child(1) { transform: skewX(14deg); }
.hearth__legs span:nth-child(3) { transform: skewX(-14deg); }

/* кнопка тихого звука огня */
.hearth__sound {
  position: absolute; right: 10px; bottom: 10px;
  display: inline-grid; place-items: center;
  width: 40px; height: 40px; padding: 0;
  border: 1px solid var(--metal-line); border-radius: 50%;
  background: rgba(27, 15, 14, 0.75); color: var(--smoke);
}
.hearth__sound:hover { color: var(--cream); background: rgba(58, 32, 28, 0.9); }
.hearth__sound .hearth__wave { opacity: .25; }
.hearth__sound[aria-pressed="true"] { color: var(--gold); border-color: var(--gold); }
.hearth__sound[aria-pressed="true"] .hearth__wave { opacity: 1; }
.hearth__sound.is-waiting { box-shadow: 0 0 0 2px rgba(255, 193, 90, 0.35); }

/* на планшете и телефоне очаг в выдвижной колонне, пониже */
@media (max-width: 1199px) {
  .hearth__niche { height: 210px; }
  .hearth__phoenix { width: 120px; height: 120px; margin-left: -60px; }
}

/* ---------- Костёр обид ----------
   Очаг теплеет от сожжённых за неделю обид: hearth--warm-1..3 (пороги в settings.php).
   is-flare: короткая вспышка, когда обида долетела. Буквы и пепел летят поверх страницы. */

/* scale, а не transform: у отсвета своя анимация через transform, scale с ней складывается */
.hearth--warm-1 .hearth__glow { scale: 1.12; }
.hearth--warm-2 .hearth__glow { scale: 1.25; filter: brightness(1.15); }
.hearth--warm-3 .hearth__glow { scale: 1.4; filter: brightness(1.3); }
.hearth__fire { transform-origin: 50% 100%; transition: scale .8s ease; }
.hearth--warm-1 .hearth__fire { scale: 1.04; }
.hearth--warm-2 .hearth__fire { scale: 1.1; }
.hearth--warm-3 .hearth__fire { scale: 1.17; }
.hearth--warm-3 .hearth__phoenix { filter: drop-shadow(0 0 20px rgba(255, 193, 90, 0.8)) drop-shadow(0 0 40px rgba(232, 67, 42, 0.5)); }
.hearth.is-flare .hearth__glow { animation: hearth-flare 1.5s ease-out; }
@keyframes hearth-flare {
  0%   { opacity: .8; transform: scale(1); }
  25%  { opacity: 1; transform: scale(1.6); filter: brightness(1.6); }
  100% { opacity: .8; transform: scale(1); }
}
.hearth__week {
  margin-top: 6px;
  color: var(--text-dim); font: italic 500 .86rem/1.3 var(--font-serif); text-align: center;
}

.burn-open {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  width: 100%; min-height: 40px; margin: 0 0 14px; padding: 0 12px;
  border: 1px dashed var(--metal-line); border-radius: var(--radius-sm);
  background: var(--well); color: var(--text);
  font: 700 .95rem/1 var(--font-serif);
}
.burn-open:hover { color: var(--heading); border-color: var(--flame); background: var(--hover); }

.burn {
  width: min(440px, calc(100vw - 32px));
  padding: 0;
  border: 1px solid var(--metal-line); border-radius: var(--radius);
  background:
    radial-gradient(ellipse 80% 60% at 50% 120%, rgba(255, 122, 47, 0.28), transparent 70%),
    var(--panel);
  color: var(--text);
  box-shadow: var(--shadow-pop);
}
.burn::backdrop { background: var(--scrim); }
.burn__form { display: grid; gap: 10px; padding: 20px; }
.burn__title { font: 700 1.4rem/1.2 var(--font-serif); color: var(--heading); }
.burn__lead { color: var(--text); font-size: .95rem; }
.burn__text {
  width: 100%; min-height: 96px; padding: 10px 12px;
  border: 1px solid var(--line-strong); border-radius: 10px;
  background: var(--bg); color: var(--heading);
  line-height: 1.45; resize: vertical;
}
.burn__text:focus { outline: none; border-color: var(--link); box-shadow: 0 0 0 3px var(--focus-ring); }
.burn__privacy { color: var(--text-dim); font-size: .82rem; }
.burn__msg:empty { display: none; }
.burn__msg { color: var(--glow); font-size: .9rem; }
.burn__msg.is-bad { color: var(--danger); }
.burn__actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }

/* буквы обиды в полёте: поверх всего, без событий мыши */
.burn-fly {
  position: fixed; z-index: 90; margin: 0;
  white-space: pre-wrap; overflow-wrap: anywhere;
  color: var(--cream); pointer-events: none;
}
.burn-fly span { display: inline-block; white-space: pre; }
.burn-ash {
  position: fixed; z-index: 90; width: 3px; height: 3px; border-radius: 50%;
  background: #8f7f77; pointer-events: none;
}
.burn-toast {
  position: fixed; z-index: 95; left: 50%; bottom: 24px; transform: translateX(-50%);
  max-width: calc(100vw - 32px); padding: 10px 18px;
  border: 1px solid var(--metal-line); border-radius: 999px;
  background: var(--panel); color: var(--heading);
  box-shadow: var(--shadow-pop);
  font: 600 .95rem/1.3 var(--font-serif); text-align: center;
  transition: opacity .5s ease;
}
.burn-toast.is-out { opacity: 0; }

/* ---------- Огненная Белка ----------
   Силуэт рисуется в очаге (theme/scene.php), клиент копирует его для забега по чату.
   hearth--sq-asleep: свернулась у чаши, над ней «z z z»; hearth--sq-hiding: из трубы торчит
   только кончик огненного хвоста; hearth--sq-away: её нет, бегает где-то. */

.squirrel-svg { width: 64px; height: 48px; overflow: visible; }
.squirrel-svg__tail { fill: var(--flame); }
.squirrel-svg__flame { fill: var(--gold); stroke: none; }
.squirrel-svg__body { fill: #c8461f; }
.squirrel-svg__head { fill: #d9582c; }
.squirrel-svg__ear { fill: #d9582c; }
.squirrel-svg__eye { fill: var(--ash); }
.squirrel-svg__paw { fill: none; stroke: #8a2a12; stroke-width: 2.5; stroke-linecap: round; }
.squirrel-svg .squirrel-svg__tail { filter: drop-shadow(0 0 4px rgba(255, 122, 47, 0.8)); }

.hearth__squirrel {
  position: absolute; left: 14px; bottom: 6px;
  width: 54px; height: 40px;
  opacity: 0; transform: translateY(8px);
  transition: opacity .6s ease, transform .6s ease;
  pointer-events: none;
}
.hearth__squirrel .squirrel-svg { width: 54px; height: 40px; }
/* картинки белки (imgs/squirrel*.png): тот же размер, лёгкое свечение */
.squirrel-img { display: block; width: 100%; height: auto; filter: drop-shadow(0 0 5px rgba(255, 122, 47, 0.55)); }
.hearth__squirrel { width: 58px; height: auto; }
.hearth__squirrel .squirrel-img { width: 58px; }
.hearth--sq-asleep .hearth__squirrel { opacity: 1; transform: none; }
.hearth--sq-asleep .hearth__squirrel .squirrel-svg,
.hearth--sq-asleep .hearth__squirrel .squirrel-img { animation: sq-breathe 3.5s ease-in-out infinite; transform-origin: 50% 100%; }
@keyframes sq-breathe { 50% { transform: scale(1.04, .96); } }
.hearth__zzz {
  position: absolute; left: 38px; top: -14px;
  color: var(--cream); font: italic 700 .7rem/1 var(--font-serif); letter-spacing: .1em;
  opacity: 0;
}
.hearth--sq-asleep .hearth__zzz { animation: sq-zzz 3s ease-in-out infinite; }
@keyframes sq-zzz {
  0%   { opacity: 0; transform: translate(0, 4px); }
  40%  { opacity: .9; }
  100% { opacity: 0; transform: translate(8px, -10px); }
}
/* прячется в трубе: кончик хвоста торчит сверху ниши и подрагивает */
.hearth__tail {
  position: absolute; left: 50%; top: 0; margin-left: 22px;
  width: 18px; height: 0;
  border-radius: 40% 40% 50% 50% / 30% 30% 70% 70%;
  background: linear-gradient(180deg, var(--ember), var(--flame) 50%, var(--gold)); /* золотой кончик внизу */
  box-shadow: 0 0 8px rgba(255, 122, 47, 0.8);
  transition: height .6s ease;
}
.hearth--sq-hiding .hearth__tail { height: 34px; animation: sq-tail 1.8s ease-in-out infinite; transform-origin: 50% 0; }
@keyframes sq-tail { 50% { transform: rotate(8deg); } }

.hearth__nut {
  position: absolute; left: 10px; bottom: 10px; z-index: 2;
  display: inline-grid; place-items: center;
  width: 40px; height: 40px; padding: 0;
  border: 1px solid var(--metal-line); border-radius: 50%;
  background: rgba(27, 15, 14, 0.75);
  font-size: 1.1rem;
}
.hearth__nut:hover { background: rgba(58, 32, 28, 0.9); border-color: var(--gold); }
.hearth__nut:disabled { opacity: .5; }
/* когда белка спит у чаши, орешек сдвигается, чтобы её не загораживать */
.hearth--sq-asleep .hearth__squirrel { left: 56px; }

/* забег по чату */
.squirrel-run {
  position: absolute; left: 0; bottom: 118px; z-index: 6;
  width: 64px; height: 48px;
  pointer-events: none;
}
.squirrel-run .squirrel-svg,
.squirrel-run .squirrel-img { animation: sq-hop .32s ease-in-out infinite; }
.squirrel-run { width: 72px; height: auto; }
@keyframes sq-hop { 50% { transform: translateY(-10px) rotate(-6deg); } }
.squirrel-spark {
  position: absolute; z-index: 5;
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--gold); box-shadow: 0 0 6px 1px rgba(255, 122, 47, 0.9);
  pointer-events: none;
}
@media (max-width: 767px) { .squirrel-run { bottom: 84px; } }

/* подпалённое сообщение: обугленные края, по углу пляшет огонёк */
.msg--scorched {
  box-shadow: inset 0 0 0 1px rgba(122, 42, 18, 0.9), inset 0 0 22px 4px rgba(40, 14, 6, 0.9);
  animation: sq-scorch 1.2s ease-out;
}
.msg--scorched .msg__body { color: #e7b58f; }
.msg--scorched::after {
  content: "🔥"; position: absolute; right: 44px; top: -6px;
  font-size: .9rem; animation: dare-flicker 1s ease-in-out infinite;
}
@keyframes sq-scorch { 0% { background: rgba(255, 122, 47, 0.35); } }
[data-theme="day"] .msg--scorched { box-shadow: inset 0 0 0 1px rgba(122, 42, 18, 0.6), inset 0 0 20px 3px rgba(90, 40, 15, 0.35); }
[data-theme="day"] .msg--scorched .msg__body { color: #6a2a12; }

/* ---------- Проверка Министерства: баннер над полем ввода ---------- */

.ministry {
  position: relative;
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 10px; align-items: center;
  margin: 0 14px 8px; padding: 10px 14px 14px;
  border: 1px solid #b08a3a; border-radius: var(--radius-sm);
  background: linear-gradient(180deg, #f3e3c8, #e8d2a8);
  color: #2b1715;
  box-shadow: 0 8px 18px -10px rgba(0, 0, 0, 0.8);
  overflow: hidden;
}
.ministry__seal { grid-row: span 2; font-size: 1.6rem; }
.ministry__text { font: 700 .98rem/1.3 var(--font-serif); }
.ministry__meta { font-size: .82rem; color: #5a3a2a; font-weight: 700; font-variant-numeric: tabular-nums; }
.ministry__bar { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(43, 23, 21, 0.15); }
.ministry__bar span { display: block; height: 100%; width: 100%; background: var(--ember); transition: width 1s linear; }

@media (prefers-reduced-motion: reduce) {
  .hearth--sq-asleep .hearth__squirrel .squirrel-svg, .hearth--sq-asleep .hearth__squirrel .squirrel-img,
  .hearth--sq-asleep .hearth__zzz, .hearth--sq-hiding .hearth__tail,
  .msg--scorched, .msg--scorched::after { animation: none; }
  .hearth--sq-asleep .hearth__zzz { opacity: .8; }
}

/* ---------- Плакат «Разыскивается: Сайра Долт» ----------
   Пожелтевший лист на гвозде в левой колонне, чуть перекошен. Силуэт сепией, на плече огненная белка.
   Поверх кто-то из студентов дописал красным «Никогда не отступать!».
   На #ecd9b4: текст #3a1e16 11.0, заголовки #7a1d14 7.5, подписи #5a3a2a 7.3, граффити #a8261a 5.1. */

.wanted-mini {
  position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  width: calc(100% - 12px); margin: 18px auto 10px; padding: 16px 10px 12px;
  border: 0; border-radius: 2px 4px 3px 2px;
  background:
    radial-gradient(ellipse at 20% 15%, rgba(255, 255, 255, 0.35), transparent 55%),
    radial-gradient(ellipse at 85% 90%, rgba(120, 70, 30, 0.28), transparent 60%),
    #ecd9b4;
  color: #3a1e16;
  box-shadow: 0 10px 18px -10px rgba(0, 0, 0, 0.9), 0 2px 3px rgba(0, 0, 0, 0.4);
  transform: rotate(-2deg);
  transition: transform .3s cubic-bezier(.2, .8, .2, 1), box-shadow .3s ease;
  text-align: center;
}
.wanted-mini:hover, .wanted-mini:focus-visible { transform: rotate(0) translateY(-2px); box-shadow: 0 14px 22px -10px rgba(0, 0, 0, 0.9), 0 0 16px rgba(255, 122, 47, 0.25); }
/* оторванный уголок */
.wanted-mini::after {
  content: ""; position: absolute; right: 0; bottom: 0;
  border-style: solid; border-width: 0 0 16px 16px;
  border-color: transparent transparent var(--panel) transparent;
}
.wanted-mini__nail {
  position: absolute; top: 5px; left: 50%; width: 9px; height: 9px; margin-left: -4.5px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #f0b07a, #6e3518);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}
.wanted-mini__head { font: 800 1rem/1 var(--font-serif); letter-spacing: .12em; text-transform: uppercase; color: #7a1d14; }
.wanted-mini .wanted__sil { width: 86px; height: 86px; margin: 2px 0; }
.wanted-mini__name { font: 700 1.1rem/1.1 var(--font-serif); }
.wanted-mini__graffiti {
  position: absolute; left: 4px; right: 4px; top: 128px; /* поперёк плеч портрета, лицо и имя не задевает */
  color: #a8261a; font: italic 700 .9rem/1 var(--font-serif);
  transform: rotate(-12deg); opacity: .85;
  text-shadow: 0 0 1px rgba(168, 38, 26, 0.4);
  pointer-events: none;
}
.wanted-mini__latest {
  margin-top: 6px; padding-top: 6px; width: 100%;
  border-top: 1px dashed rgba(90, 58, 42, 0.45);
  color: #5a3a2a; font: italic 500 .8rem/1.3 var(--font-serif);
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}

/* портрет на плакате: тёплая сепия, как отпечаток на розыскном листе, белка на плече в цвете */
.wanted__photo { position: relative; display: block; line-height: 0; }
.wanted__img {
  display: block; width: 100%; height: auto;
  filter: sepia(.55) saturate(.85) contrast(1.05) brightness(.95);
  box-shadow: inset 0 0 0 1px rgba(90, 58, 42, 0.5);
}
.wanted__photo-sq {
  position: absolute; right: -8%; bottom: 2%;
  width: 46%; height: auto;
  filter: drop-shadow(0 0 4px rgba(255, 122, 47, 0.8));
}
.wanted-mini .wanted__photo { width: 96px; margin: 4px 0; border: 2px solid #5a3a2a; }
.wanted-mini .wanted__photo .wanted__img { box-shadow: none; }

/* силуэт сепией */
.wanted__sil-hair { fill: #5a3a2a; }
.wanted__sil-face { fill: #8a6a4e; }
.wanted__sil-body { fill: #5a3a2a; }
.wanted__sil-q { fill: #ecd9b4; font: 700 20px/1 var(--font-serif); }
.wanted__sil-sq { fill: #c8461f; }
.wanted__sil-sq-tail { fill: var(--flame); filter: drop-shadow(0 0 3px rgba(255, 122, 47, 0.8)); }

/* большой плакат */
.wanted {
  width: min(560px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  padding: 0; border: 0; background: transparent; overflow: visible;
}
.wanted::backdrop { background: var(--scrim); }
.wanted__paper {
  position: relative;
  max-height: calc(100dvh - 24px); overflow-y: auto;
  padding: 26px 26px 20px;
  border-radius: 3px;
  background:
    radial-gradient(ellipse at 15% 10%, rgba(255, 255, 255, 0.4), transparent 55%),
    radial-gradient(ellipse at 90% 95%, rgba(120, 70, 30, 0.25), transparent 60%),
    #ecd9b4;
  color: #3a1e16;
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.9);
}
.wanted__close {
  position: absolute; top: 8px; right: 10px;
  width: 36px; height: 36px; border: 0; border-radius: 50%;
  background: transparent; color: #5a3a2a; font-size: 1.6rem; line-height: 1;
}
.wanted__close:hover { background: rgba(90, 58, 42, 0.12); }
.wanted__head {
  text-align: center;
  font: 800 clamp(1.6rem, 6vw, 2.3rem)/1 var(--font-serif); letter-spacing: .14em; text-transform: uppercase;
  color: #7a1d14;
  border-top: 3px double #7a1d14; border-bottom: 3px double #7a1d14; padding: 8px 0;
}
.wanted__top { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 16px; margin-top: 16px; align-items: start; }
.wanted__portrait { margin: 0; padding: 6px; border: 2px solid #5a3a2a; background: rgba(255, 255, 255, 0.25); text-align: center; }
.wanted__portrait .wanted__sil { width: 100%; height: auto; }
.wanted__portrait figcaption { color: #5a3a2a; font: italic 500 .78rem/1.2 var(--font-serif); }
.wanted__name { font: 800 1.8rem/1.05 var(--font-serif); }
.wanted__who { margin-top: 4px; color: #5a3a2a; font-style: italic; }
.wanted__charge, .wanted__note { margin-top: 10px; font-size: .95rem; line-height: 1.45; }
.wanted__from { margin-top: 14px; text-align: center; color: #5a3a2a; font: 600 .82rem/1.3 var(--font-sans); letter-spacing: .06em; text-transform: uppercase; }
.wanted__graffiti {
  display: block; margin: 14px 6px 0 0;
  text-align: right;
  color: #a8261a; font: italic 800 1.5rem/1 var(--font-serif);
  transform: rotate(-5deg); opacity: .85; pointer-events: none;
}

.seen { margin-top: 18px; padding-top: 14px; border-top: 1px dashed rgba(90, 58, 42, 0.5); }
.seen__title { font: 700 1.2rem/1.2 var(--font-serif); color: #7a1d14; }
.seen__empty { margin-top: 8px; color: #5a3a2a; font-style: italic; }
.seen__list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 8px; }
.seen__item {
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.35);
  border-left: 3px solid #c27a4a;
}
.seen__text { font: italic 500 1rem/1.35 var(--font-serif); overflow-wrap: anywhere; }
.seen__meta { margin-top: 2px; color: #5a3a2a; font-size: .78rem; font-weight: 700; }
.seen__remove { margin-left: 6px; padding: 0; border: 0; background: none; color: #a8261a; font-size: .78rem; text-decoration: underline; }
.seen__remove.is-confirm { font-weight: 800; }
.seen__form { margin-top: 12px; }
.seen__label { display: block; font: 700 1rem/1.2 var(--font-serif); color: #3a1e16; }
.seen__row { display: flex; gap: 8px; margin-top: 6px; }
.seen__input {
  flex: 1; min-width: 0; min-height: 42px; padding: 0 12px;
  border: 1px solid rgba(90, 58, 42, 0.5); border-radius: 10px;
  background: #fffaf3; color: #3a1e16;
}
.seen__input:focus { outline: none; border-color: #a8261a; box-shadow: 0 0 0 3px rgba(168, 38, 26, 0.2); }
.seen__go { min-height: 42px; white-space: nowrap; }
.seen__msg { min-height: 1.2em; margin-top: 6px; color: #5a3a2a; font-size: .88rem; }
.seen__msg:empty { display: none; }
.seen__msg.is-bad { color: #a8261a; font-weight: 700; }

@media (max-width: 560px) {
  .wanted__paper { padding: 22px 16px 16px; }
  .wanted__top { grid-template-columns: 100px minmax(0, 1fr); gap: 12px; }
  .wanted__name { font-size: 1.4rem; }
  .wanted__graffiti { font-size: 1.15rem; }
  .seen__row { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  .wanted-mini, .wanted-mini:hover { transition: none; }
}

/* ---------- «Феникс или Роза»: весы в шапке ----------
   Две половинки: слева Тереса и феникс (огонь), справа Сайра и роза. Выбранная сторона залита
   своим цветом; при ничьей двоеточие светится. На телефоне только значки и счёт. */

.sides {
  display: inline-flex; align-items: stretch; flex: none; /* шапка не сжимает весы */
  margin-left: auto;
  border: 1px solid var(--metal-line); border-radius: 999px;
  background: var(--well);
  overflow: hidden;
}
.sides + .theme-btn { margin-left: 0; }
.sides__btn {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 42px; padding: 0 12px;
  border: 0; background: none; color: var(--text);
  font: 700 .9rem/1 var(--font-serif);
}
.sides__btn:hover { background: var(--hover); color: var(--heading); }
.sides__n { min-width: 1.2em; font: 800 1rem/1 var(--font-sans); font-variant-numeric: tabular-nums; text-align: center; }
.sides__btn--phoenix[aria-pressed="true"] { background: var(--ember); color: var(--ash); }
.sides__btn--rose[aria-pressed="true"] { background: var(--rose); color: var(--cream); }
.sides__colon { display: grid; place-items: center; padding: 0 2px; color: var(--text-dim); font-weight: 800; }
.sides.is-tie .sides__colon { color: var(--gold); text-shadow: 0 0 8px var(--gold); }

/* значок стороны у имени в «Круге у огня» */
.guest__side { font-weight: 400; }

@media (max-width: 767px) {
  .sides__who { display: none; }
  .sides__btn { padding: 0 8px; gap: 4px; min-height: 40px; }
}
/* на узком экране от названия гостиной остаётся только герб: весам нужнее место */
@media (max-width: 459px) {
  .brand > div { display: none; }
}
@media (max-width: 379px) {
  .sides__btn { padding: 0 6px; }
  .brand__crest { display: block; } /* движок прячет герб на узких, но без названия он нужен */
}

/* ---------- Живой очаг: огонь по оживлённости чата ----------
   hearth--buzz-0 тлеет … hearth--buzz-3 ревёт (ступень присылает сервер, assets/js/hearth.js).
   Высота пламени через transform (тепло недели от Костра обид идёт через scale, они складываются),
   скорость мерцания через --flick, яркость ниши через накладку ::after, число искр через видимость.
   is-puff: короткая вспышка, когда в чат пришло сообщение. */

.hearth__fire { transform-origin: 50% 100%; transition: transform 1.2s ease, filter .6s ease, scale .8s ease; }
.hearth__niche::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse 75% 60% at 50% 80%, rgba(255, 193, 90, 0.35), rgba(255, 122, 47, 0.12) 45%, transparent 75%);
  opacity: .5; transition: opacity 1.2s ease;
}

.hearth--buzz-0 { --flick: 1.7; }
.hearth--buzz-0 .hearth__fire { transform: scaleY(.62) scaleX(.9); filter: saturate(.8) brightness(.85); }
.hearth--buzz-0 .hearth__niche::after { opacity: .1; }
.hearth--buzz-0 .hearth__phoenix { opacity: .6; }
.hearth--buzz-0 .spark:nth-child(n+4) { display: none; }

.hearth--buzz-1 { --flick: 1.1; }
.hearth--buzz-1 .hearth__fire { transform: scaleY(.86); }
.hearth--buzz-1 .hearth__niche::after { opacity: .35; }
.hearth--buzz-1 .spark:nth-child(n+8) { display: none; }

.hearth--buzz-2 { --flick: .85; }
.hearth--buzz-2 .hearth__fire { transform: scaleY(1.04); }
.hearth--buzz-2 .hearth__niche::after { opacity: .7; }

.hearth--buzz-3 { --flick: .62; }
.hearth--buzz-3 .hearth__fire { transform: scaleY(1.2) scaleX(1.05); filter: brightness(1.12); }
.hearth--buzz-3 .hearth__niche::after { opacity: 1; }
.hearth--buzz-3 .spark { animation-duration: 2.2s; }
.hearth--buzz-3 .hearth__phoenix { filter: drop-shadow(0 0 22px rgba(255, 193, 90, 0.85)) drop-shadow(0 0 44px rgba(232, 67, 42, 0.55)); }

.hearth.is-puff .hearth__fire { filter: brightness(1.35); transition: filter .15s ease; }
.hearth.is-puff .hearth__niche::after { opacity: 1; transition: opacity .15s ease; }

.hearth__mood {
  margin-top: 6px;
  color: var(--text-dim); font: italic 600 .86rem/1.3 var(--font-serif); text-align: center;
}
.hearth__mood + .hearth__week { margin-top: 0; }

/* ---------- Круг у огня ---------- */

.online { padding: 14px 12px 16px; }
.online__title {
  display: flex; align-items: center; gap: 8px;
  color: var(--cream);
}
.online__title::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--metal-line), transparent); }
.guest--here .guest__status::before { background: var(--flame); box-shadow: 0 0 6px var(--flame); }
.online-chip__lamp { background: var(--flame); box-shadow: 0 0 8px var(--flame); }

/* ---------- Пергамент с критериями ----------
   Свиток на медных стержнях, внизу сургучная роза. На пергаменте #f3e3c8: текст #3a1e16 12.1,
   заголовок #7a1d14 8.3, девиз #5a2a1e 9.3. */

.scroll { margin: 18px 6px 4px; }
.scroll__rod {
  display: block; height: 10px; margin: 0 -6px;
  border-radius: 5px;
  background: linear-gradient(180deg, #f0b07a, #c27a4a 45%, #6e3518);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
}
.scroll__paper {
  position: relative;
  padding: 14px 16px 20px;
  color: #3a1e16;
  background:
    radial-gradient(ellipse at 15% 10%, rgba(255, 255, 255, 0.45), transparent 55%),
    radial-gradient(ellipse at 85% 90%, rgba(160, 90, 40, 0.18), transparent 60%),
    var(--paper);
  box-shadow: inset 0 8px 10px -8px rgba(0, 0, 0, 0.45), inset 0 -8px 10px -8px rgba(0, 0, 0, 0.45);
}
.scroll__title {
  font: 700 1.2rem/1.2 var(--font-serif);
  color: #7a1d14;
  text-align: center;
}
.scroll__list { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 4px; }
.scroll__list li {
  display: flex; align-items: baseline; gap: 8px;
  font: 600 1.02rem/1.3 var(--font-serif);
}
.scroll__list li::before {
  content: ""; flex: none;
  width: 7px; height: 7px; transform: translateY(-2px) rotate(45deg);
  background: var(--rose);
}
.scroll__motto {
  margin-top: 12px; padding-top: 8px;
  border-top: 1px dashed rgba(122, 29, 20, 0.35);
  font: italic 500 .92rem/1.35 var(--font-serif);
  color: #5a2a1e; text-align: center;
}
.scroll__seal {
  position: absolute; right: 12px; bottom: -14px;
  width: 30px; height: 30px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #e0485c, #c4283c 45%, #7a1424 85%);
  box-shadow: 0 3px 5px rgba(0, 0, 0, 0.55);
}
.scroll__seal::after {
  content: "❀";
  position: absolute; inset: 0;
  display: grid; place-items: center;
  color: #ffd9d0; font-size: 15px; line-height: 1;
}

/* ---------- Страницы-пороги: вход, нет доступа ---------- */

/* Фон страниц-порогов: картинка порога под тёплой дымкой.
   Задан здесь, а не токеном: url() в переменной считался бы от файла движка. */
.gate-page {
  background:
    linear-gradient(rgba(27, 15, 14, 0.62), rgba(27, 15, 14, 0.90)),
    url("../imgs/sairesbg-final.png") center / cover no-repeat fixed,
    var(--ash);
}

.gate__card { border-color: var(--metal-line); }
.gate__crest { background: var(--coal); }
.gate__motto { display: block; width: min(100%, 260px); height: auto; margin: 10px auto 0; }

/* ---------- Доска объявлений: листки на тёплой деревянной доске ----------
   Текст листка #3a1e16 на пергаменте #f3e3c8: контраст 12.1, подписи #6b4636 6.5, ссылки #a8321c 5.3. */

.board-panel,
.members-panel,
.prefs-panel {
  display: flex; flex-direction: column;
  min-height: 0;
  overflow: hidden;
}
.board-panel .panel__head,
.members-panel .panel__head,
.prefs-panel .panel__head { text-align: center; border-bottom: 0; }

.board {
  flex: 1; min-height: 0;
  overflow-y: auto;
  list-style: none;
  margin: 4px 22px 22px;
  padding: 26px 22px 30px;
  border: 10px solid #3a1d12;
  border-radius: 8px;
  outline: 1px solid var(--metal-line);
  background:
    radial-gradient(ellipse at 80% 0%, rgba(255, 122, 47, 0.12), transparent 60%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.25), rgba(0, 0, 0, 0.10)),
    url("img/wood.svg") 0 0 / 180px 320px repeat,
    #3a2018;
  box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.55), 0 14px 24px -14px rgba(0, 0, 0, 0.8);
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  column-gap: 26px;
  align-content: start; align-items: start;
  scrollbar-width: thin;
}
.board--empty { place-items: center; align-content: center; grid-template-columns: 1fr; }
.board__empty,
.gallery__empty {
  max-width: 26rem;
  padding: 18px 22px;
  background: var(--paper);
  color: #3a1e16;
  font: 600 1.05rem/1.45 var(--font-serif);
  text-align: center;
  border-radius: 3px;
  box-shadow: 0 10px 18px -10px rgba(0, 0, 0, 0.8);
  transform: rotate(-1deg);
}
.gallery__empty { margin: 28px auto; }

.note { padding: 16px 4px 18px; }
.note__paper {
  position: relative;
  padding: 22px 20px 16px;
  color: #3a1e16;
  background:
    radial-gradient(ellipse at 15% 10%, rgba(255, 255, 255, 0.45), transparent 55%),
    radial-gradient(ellipse at 90% 95%, rgba(160, 90, 40, 0.16), transparent 60%),
    var(--paper);
  border-radius: 2px 3px 2px 4px;
  box-shadow: 0 12px 18px -10px rgba(0, 0, 0, 0.85), 0 2px 4px rgba(0, 0, 0, 0.35);
  transition: transform .35s cubic-bezier(.2, .8, .2, 1), box-shadow .35s ease;
}
.note--t1 .note__paper { transform: rotate(-1.1deg); }
.note--t2 .note__paper { transform: rotate(.8deg); }
.note--t3 .note__paper { transform: rotate(-.4deg); }
.note--t4 .note__paper { transform: rotate(1.2deg); }
.note--t5 .note__paper { transform: rotate(-.8deg); }
.note__paper:hover,
.note__paper:focus-within {
  transform: rotate(0) translateY(-3px);
  box-shadow: 0 18px 26px -12px rgba(0, 0, 0, 0.9), 0 0 22px rgba(255, 122, 47, 0.2);
}

/* медная кнопка-гвоздик с розовой шляпкой */
.note__seal {
  position: absolute; top: -12px; left: 50%;
  width: 24px; height: 24px; margin-left: -12px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #e0485c, #c4283c 45%, #7a1424 85%);
  box-shadow: 0 0 0 2px #c27a4a, 0 3px 5px rgba(0, 0, 0, 0.55);
}
.note__meta {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 10px;
  margin-bottom: 6px;
  font-size: .78rem; letter-spacing: .03em;
  color: #6b4636;
}
.note__from { font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.note__title { font: 700 1.3rem/1.2 var(--font-serif); color: #7a1d14; }
.note__for {
  display: inline-block; margin-top: 6px; padding: 1px 9px;
  border: 1px solid rgba(122, 29, 20, 0.35); border-radius: 999px;
  font-size: .78rem; color: #7a1d14;
}
.note__body { margin-top: 10px; font-size: .95rem; line-height: 1.55; overflow-wrap: anywhere; }
.note__body > * + * { margin-top: .6em; }
.note__body h2, .note__body h3, .note__body h4 { font: 700 1.1rem/1.25 var(--font-serif); color: #7a1d14; }
.note__body a { color: #a8321c; text-decoration: underline; text-underline-offset: 2px; }
.note__body a:hover { color: #7a1d14; }
.note__body ul, .note__body ol { padding-left: 1.3em; }
.note__body ul { list-style: disc; }
.note__body ol { list-style: decimal; }
.note__body blockquote { padding-left: 12px; border-left: 3px solid #c27a4a; font-style: italic; color: #5a2a1e; }
.note__body img { max-width: 100%; height: auto; border-radius: 3px; }
.note__body table { border-collapse: collapse; max-width: 100%; display: block; overflow-x: auto; }
.note__body td, .note__body th { border: 1px solid rgba(107, 70, 54, 0.4); padding: 4px 8px; text-align: left; vertical-align: top; }
.note__body hr { border: 0; border-top: 1px dashed rgba(107, 70, 54, 0.5); }
.note__body .al-center { text-align: center; }
.note__body .al-right { text-align: right; }
.note__body .al-justify { text-align: justify; }
.js .note__body { max-height: 15em; overflow: hidden; }
.js .note__body.is-clamped {
  -webkit-mask-image: linear-gradient(180deg, #000 70%, transparent);
          mask-image: linear-gradient(180deg, #000 70%, transparent);
}
.js .note__body.is-open { max-height: none; -webkit-mask-image: none; mask-image: none; }
.note__more {
  margin-top: 8px; padding: 0;
  border: 0; background: none;
  color: #a8321c; font: 800 .88rem/1.4 var(--font-sans);
}
.note__more:hover { color: #7a1d14; text-decoration: underline; }
.note__more:focus-visible { outline: 2px solid #a8321c; outline-offset: 2px; border-radius: 2px; }
.note__sign { margin-top: 12px; text-align: right; font: italic 500 1.02rem/1.2 var(--font-serif); color: #5a2a1e; }

/* новое с прошлого захода: огненная лента в углу (ash на flame 7.2) */
.note.is-new .note__meta { padding-right: 58px; }
.note.is-new .note__paper::before {
  content: "новое";
  position: absolute; top: 10px; right: -6px;
  padding: 2px 10px 2px 8px;
  background: var(--flame); color: var(--ash);
  font: 800 .68rem/1.4 var(--font-sans);
  letter-spacing: .08em; text-transform: uppercase;
  border-radius: 2px 0 0 2px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.35);
}

@media (max-width: 767px) {
  .board { margin: 0 10px 14px; padding: 20px 10px 22px; border-width: 8px; }
  .note { padding: 14px 2px 14px; }
  .note__paper { padding: 20px 16px 14px; }
  .board-panel .panel__sub,
  .members-panel .panel__sub,
  .prefs-panel .panel__sub { display: block; font-size: .85rem; }
}

/* ---------- Участники: портреты в медных рамах ---------- */

.gallery { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.gallery--empty { display: grid; place-items: center; padding: 20px; }
.gallery__bar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px 14px;
  padding: 0 22px 10px;
}
.gallery__tabs {
  display: inline-flex; gap: 4px; padding: 4px;
  border: 1px solid var(--metal-line); border-radius: 999px;
  background: var(--well);
}
.gallery__tab {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 38px; padding: 0 16px;
  border: 0; border-radius: 999px;
  background: none; color: var(--text);
  font: 700 1.02rem/1 var(--font-serif);
}
.gallery__tab:hover { color: var(--heading); background: var(--hover); }
.gallery__tab[aria-selected="true"] { background: var(--accent); color: var(--on-accent); }
.gallery__count {
  min-width: 22px; padding: 1px 6px;
  border-radius: 999px;
  background: var(--line-strong);
  font: 800 .74rem/1.4 var(--font-sans); text-align: center;
  font-variant-numeric: tabular-nums;
}
.gallery__tab[aria-selected="true"] .gallery__count { background: rgba(27, 15, 14, 0.18); }
.gallery__search {
  width: min(100%, 240px); min-height: 40px; padding: 0 14px;
  border: 1px solid var(--line-strong); border-radius: 999px;
  background: var(--well); color: var(--heading);
}
.gallery__search::placeholder { color: var(--text-dim); opacity: 1; }
.gallery__search:focus { outline: none; border-color: var(--link); box-shadow: 0 0 0 3px var(--focus-ring); }
.gallery__halls { flex: 1; min-height: 0; overflow-y: auto; padding: 0 22px 24px; scrollbar-width: thin; }
.hall__lead {
  margin: 2px auto 4px; max-width: 34rem;
  text-align: center; color: var(--text-dim);
  font: italic 500 1rem/1.4 var(--font-serif);
}

/* медная табличка курса (ash на copper 5.4) */
.wing { margin-top: 22px; }
.wing__label { display: flex; align-items: center; gap: 10px; font: inherit; }
.wing__label::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--metal-line), transparent); }
.wing__plaque {
  padding: 3px 12px;
  border-radius: 4px;
  background: linear-gradient(180deg, #e09a68, #c27a4a);
  color: var(--ash);
  font: 700 .95rem/1.2 var(--font-serif); letter-spacing: .03em;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.wing__count { color: var(--text-dim); font: 800 .8rem/1 var(--font-sans); font-variant-numeric: tabular-nums; }
.wing__list {
  list-style: none; margin: 12px 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(122px, 1fr)); gap: 14px 10px;
}
.member__card {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  height: 100%; padding: 12px 6px 10px;
  border-radius: var(--radius-sm);
  color: var(--text); text-decoration: none; text-align: center;
  transition: background .2s ease, transform .25s cubic-bezier(.2, .8, .2, 1);
}
.member__card:hover, .member__card:focus-visible { background: var(--hover); color: var(--text); transform: translateY(-3px); }
.member__frame {
  position: relative;
  padding: 4px;
  border-radius: 50%;
  background: conic-gradient(from 210deg, #f0b07a, #a35a2c, #5a2a12, #c27a4a, #f0b07a, #7a3a18, #c27a4a);
  box-shadow: 0 8px 14px -8px rgba(0, 0, 0, 0.85);
  transition: box-shadow .25s ease;
}
.member__card:hover .member__frame,
.member__card:focus-visible .member__frame { box-shadow: 0 10px 18px -8px rgba(0, 0, 0, 0.85), 0 0 18px rgba(255, 122, 47, 0.4); }
.member__portrait.avatar { width: 76px; height: 76px; border: 2px solid #2b1715; font-size: 1.5rem; }
.member__lamp {
  position: absolute; right: 2px; bottom: 4px;
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid #2b1715;
  background: radial-gradient(circle at 40% 35%, #fff1e0, var(--gold) 45%, var(--flame));
  box-shadow: 0 0 10px 2px rgba(255, 122, 47, 0.7);
  animation: member-lamp 2.6s ease-in-out infinite;
}
@keyframes member-lamp {
  0%, 100% { box-shadow: 0 0 8px 1px rgba(255, 122, 47, 0.55); }
  50%      { box-shadow: 0 0 14px 4px rgba(255, 122, 47, 0.85); }
}
.member__name { max-width: 100%; color: var(--heading); font: 700 1.02rem/1.15 var(--font-serif); overflow-wrap: anywhere; }
.member__sub { color: var(--text-dim); font-size: .78rem; line-height: 1.3; }
.member__badge {
  padding: 1px 8px; border-radius: 3px;
  background: var(--rose); color: var(--cream);
  font: 800 .64rem/1.5 var(--font-sans); letter-spacing: .08em; text-transform: uppercase;
}
.hall--alumni .member__frame { background: conic-gradient(from 210deg, #e3b48a, #8a5a3a, #4a2a1a, #b88660, #e3b48a, #6e4428, #b88660); }
.hall--alumni .member__name { color: var(--gold); }

@media (max-width: 767px) {
  .gallery__bar { padding: 0 10px 8px; }
  .gallery__search { width: 100%; }
  .gallery__halls { padding: 0 10px 18px; }
  .wing__list { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px 4px; }
  .member__portrait.avatar { width: 62px; height: 62px; font-size: 1.25rem; }
  .member__name { font-size: .95rem; }
}

/* ---------- Настройки ---------- */

.prefs { flex: 1; min-height: 0; overflow-y: auto; padding: 0 22px 24px; scrollbar-width: thin; }
.prefs__group { max-width: 760px; margin: 18px auto 0; }
.prefs__heading { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; font: inherit; }
.prefs__heading::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--metal-line), transparent); }
.pref {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 18px; align-items: center;
  margin: 0 0 8px; padding: 12px 16px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--well);
  box-shadow: inset 3px 0 0 var(--copper);
  min-inline-size: 0;
}
.pref__title { float: left; grid-column: 1; padding: 0; color: var(--heading); font: 700 1.1rem/1.2 var(--font-serif); }
.pref__hint { grid-column: 1; color: var(--text-dim); font-size: .85rem; line-height: 1.4; }
.pref__control { grid-column: 2; grid-row: 1 / span 2; display: flex; align-items: center; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.pref__try { min-height: 36px; padding: 0 12px; font-size: .85rem; }
.seg {
  display: inline-flex; gap: 2px; padding: 3px;
  border: 1px solid var(--metal-line); border-radius: 999px;
  background: var(--well);
}
.seg__item { position: relative; display: inline-flex; }
.seg__input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.seg__label {
  display: inline-flex; align-items: center;
  min-height: 34px; padding: 0 14px;
  border-radius: 999px;
  color: var(--text); font-size: .9rem; white-space: nowrap;
  pointer-events: none;
  transition: background .2s ease, color .2s ease;
}
.seg__item:hover .seg__label { background: var(--hover); color: var(--heading); }
.seg__input:checked + .seg__label { background: var(--accent); color: var(--on-accent); font-weight: 800; }
.seg__input:focus-visible + .seg__label { outline: 2px solid var(--link); outline-offset: 2px; }
.prefs__foot { max-width: 760px; margin: 18px auto 0; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.prefs__note { flex: 1 1 260px; color: var(--text-dim); font: italic 500 .98rem/1.4 var(--font-serif); }
.prefs__saved { flex-basis: 100%; min-height: 1.3em; color: var(--glow); font-size: .88rem; text-align: right; }
@media (max-width: 767px) {
  .prefs { padding: 0 10px 18px; }
  .pref { grid-template-columns: minmax(0, 1fr); padding: 12px; }
  .pref__control { grid-column: 1; grid-row: auto; justify-content: flex-start; margin-top: 6px; }
  .seg { max-width: 100%; overflow-x: auto; }
  .seg__label { padding: 0 11px; }
}

/* ---------- Доска «Смелых вызовов» ----------
   Сверху форма на деревянной дощечке, ниже листки-вызовы. Над каждым листком свой огонёк:
   чем больше дров подкинули, тем он выше. Отложенный или просроченный вызов тлеет углями,
   выполненный уходит в зал с золотой кромкой и пёрышком.
   Текст листка #3a1e16 на пергаменте #f3e3c8: 12.1; подписи #6b4636: 6.5. */

.dares-panel {
  display: flex; flex-direction: column;
  min-height: 0;
  overflow: hidden;
}
.dares-panel .panel__head { text-align: center; border-bottom: 0; }
.dares { position: relative; flex: 1; min-height: 0; overflow-y: auto; padding: 0 22px 24px; scrollbar-width: thin; }

/* форма в сворачиваемой дощечке: заголовок-«summary» открывает и закрывает её */
.dares__box {
  max-width: 820px; margin: 4px auto 0;
  border: 1px solid var(--metal-line); border-radius: var(--radius-sm);
  background:
    linear-gradient(180deg, rgba(27, 15, 14, 0.35), rgba(27, 15, 14, 0.55)),
    url("img/wood.svg") 0 0 / 180px 320px repeat,
    var(--panel);
  box-shadow: inset 3px 0 0 var(--ember), var(--shadow);
}
.dares__form-title {
  display: flex; align-items: center; gap: 10px;
  min-height: 48px; padding: 0 18px;
  font: 700 1.2rem/1.2 var(--font-serif); color: var(--heading);
  cursor: pointer; list-style: none;
}
.dares__form-title::-webkit-details-marker { display: none; }
.dares__form-title::before {
  content: "+"; display: inline-grid; place-items: center;
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--accent); color: var(--on-accent); font: 800 1.1rem/1 var(--font-sans);
}
.dares__box[open] > .dares__form-title::before { content: "−"; }
.dares__form {
  display: grid; gap: 10px 14px;
  grid-template-columns: minmax(0, 1fr) 190px;
  grid-template-areas:
    "what  due"
    "note  note"
    "rules go"
    "msg   msg";
  padding: 0 18px 16px;
}
.dares__field { display: grid; gap: 4px; min-width: 0; }
.dares__field--what { grid-area: what; }
.dares__field--due { grid-area: due; }
.dares__field--note { grid-area: note; }
.dare__label { color: var(--text-dim); font-size: .82rem; font-weight: 700; }
.dare__input {
  width: 100%; min-height: 42px; padding: 8px 12px;
  border: 1px solid var(--line-strong); border-radius: 10px;
  background: var(--bg); color: var(--heading);
  color-scheme: dark;
}
textarea.dare__input { resize: vertical; min-height: 56px; line-height: 1.45; }
.dare__input::placeholder { color: var(--text-dim); opacity: 1; }
.dare__input:focus { outline: none; border-color: var(--link); box-shadow: 0 0 0 3px var(--focus-ring); }
.dares__go { grid-area: go; align-self: start; }
.dares__rules { grid-area: rules; color: var(--text-dim); font: italic 500 .92rem/1.4 var(--font-serif); }
.dares__msg { grid-area: msg; min-height: 1.2em; color: var(--glow); font-size: .9rem; }
.dares__msg:empty { display: none; }
.dares__msg.is-bad { color: var(--danger); }

.dares__tabs {
  display: flex; justify-content: center; gap: 4px;
  width: max-content; max-width: 100%; margin: 18px auto 4px; padding: 4px;
  border: 1px solid var(--metal-line); border-radius: 999px;
  background: var(--well);
}
.dares__tab {
  min-height: 38px; padding: 0 16px;
  border: 0; border-radius: 999px;
  background: none; color: var(--text);
  font: 700 1.02rem/1 var(--font-serif);
}
.dares__tab:hover { color: var(--heading); background: var(--hover); }
.dares__tab[aria-selected="true"] { background: var(--accent); color: var(--on-accent); }

.dares__empty {
  max-width: 26rem; margin: 26px auto;
  padding: 18px 22px;
  background: var(--paper); color: #3a1e16;
  font: 600 1.05rem/1.45 var(--font-serif); text-align: center;
  border-radius: 3px;
  box-shadow: 0 10px 18px -10px rgba(0, 0, 0, 0.8);
  transform: rotate(-1deg);
}

.dares__list {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
  gap: 8px 18px; align-items: start;
}

.dare { padding-top: 46px; }
.dare__card {
  position: relative;
  display: flex; flex-direction: column; gap: 6px;
  padding: 16px 16px 14px;
  color: #3a1e16;
  background:
    radial-gradient(ellipse at 15% 10%, rgba(255, 255, 255, 0.45), transparent 55%),
    radial-gradient(ellipse at 90% 95%, rgba(160, 90, 40, 0.16), transparent 60%),
    var(--paper);
  border-radius: 3px 3px 6px 6px;
  border-top: 4px solid var(--copper);
  box-shadow: 0 12px 18px -10px rgba(0, 0, 0, 0.85), 0 2px 4px rgba(0, 0, 0, 0.35);
}

/* огонёк над листком: высота от дров */
.dare__fire {
  position: absolute; left: 50%; bottom: calc(100% + 2px);
  width: 34px; height: 40px; margin-left: -17px;
  display: flex; align-items: flex-end; justify-content: center;
  pointer-events: none;
}
.dare__fire > span {
  width: 18px; height: 22px;
  border-radius: 50% 50% 50% 50% / 62% 62% 38% 38%;
  background: radial-gradient(ellipse at 50% 85%, var(--gold) 0 25%, var(--flame) 45%, var(--ember) 70%, rgba(196, 40, 60, 0.6));
  box-shadow: 0 0 14px 3px rgba(255, 122, 47, 0.45);
  transform-origin: 50% 100%;
  animation: dare-flicker 1.6s ease-in-out infinite;
}
.dare--flame-2 .dare__fire > span { width: 20px; height: 28px; }
.dare--flame-3 .dare__fire > span { width: 24px; height: 34px; box-shadow: 0 0 18px 5px rgba(255, 122, 47, 0.5); }
.dare--flame-4 .dare__fire > span { width: 28px; height: 40px; box-shadow: 0 0 24px 8px rgba(255, 122, 47, 0.55); }
.dare__fire::after {
  content: ""; position: absolute; left: 4px; right: 4px; bottom: -4px; height: 6px;
  border-radius: 3px; background: linear-gradient(180deg, #c27a4a, #6e3518);
}
@keyframes dare-flicker {
  0%, 100% { transform: scale(1, 1) rotate(0); }
  30%      { transform: scale(.94, 1.08) rotate(-3deg); }
  60%      { transform: scale(1.04, .95) rotate(2deg); }
}

/* тлеет: огня нет, угли мерцают */
.dare--smolder .dare__fire > span {
  width: 22px; height: 8px; border-radius: 50%;
  background: radial-gradient(ellipse at 50% 50%, var(--flame) 0 20%, #7a2010 60%, #2b0d08);
  box-shadow: 0 0 10px 1px rgba(255, 122, 47, 0.35);
  animation: dare-embers 3s ease-in-out infinite;
}
@keyframes dare-embers { 50% { filter: brightness(1.5); } }
.dare--smolder .dare__card { filter: saturate(.75); border-top-color: #7a4a30; }

/* выполнен: пёрышко вместо огня, золотая кромка */
.dare--done .dare__fire > span { display: none; }
.dare--done .dare__fire::after { display: none; }
.dare--done .dare__fire::before { content: "🪶"; font-size: 26px; line-height: 1; filter: drop-shadow(0 0 8px rgba(255, 193, 90, 0.7)); }
.dare--done .dare__card { border-top-color: var(--gold); box-shadow: 0 0 0 1px rgba(255, 193, 90, 0.5), 0 12px 18px -10px rgba(0, 0, 0, 0.85); }

.dare__who { font-size: .8rem; color: #6b4636; font-weight: 700; letter-spacing: .02em; }
.dare__author { color: #7a1d14; }
.dare__title { font: 700 1.2rem/1.25 var(--font-serif); color: #3a1e16; overflow-wrap: anywhere; }
.dare__note { font-size: .92rem; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.dare__meta {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 10px;
  margin-top: 2px; padding-top: 6px;
  border-top: 1px dashed rgba(122, 29, 20, 0.3);
  font-size: .8rem; color: #6b4636; font-weight: 700;
}
.dare--smolder .dare__when { color: #8a2a14; }

.dare__actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.dare__btn { min-height: 36px; padding: 0 12px; font-size: .86rem; }
/* на пергаменте кнопки-контуры тёмные (на светлом), включённые залиты огнём */
.dare__card .btn--ghost { border-color: rgba(122, 29, 20, 0.4); color: #7a1d14; }
.dare__card .btn--ghost:hover { background: rgba(232, 67, 42, 0.10); color: #5a120c; }
.dare__card .btn--ghost.is-on { background: #a8321c; border-color: #a8321c; color: #fff1e0; }
.dare__card .btn.is-confirm { background: #7a1d14; color: #fff1e0; }
.dare__remove {
  margin-left: auto; min-height: 36px; padding: 0 8px;
  border: 0; background: none;
  color: #6b4636; font-size: .8rem; text-decoration: underline;
}
.dare__remove.is-confirm { color: #a8321c; font-weight: 800; }

.dare__postpone { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-top: 6px; }
.dare__postpone .dare__label { color: #6b4636; }
.dare__postpone .dare__input { width: auto; min-height: 36px; background: #fffaf3; color: #3a1e16; color-scheme: light; border-color: rgba(122, 29, 20, 0.35); }
.dare__hint { flex-basis: 100%; color: #6b4636; font-size: .78rem; }

/* феникс взлетает над доской, когда вызов выполнен */
.dares__phoenix {
  position: absolute; left: 50%; top: 40%; z-index: 5;
  width: 140px; height: 140px; margin-left: -70px;
  pointer-events: none;
  filter: drop-shadow(0 0 18px rgba(255, 122, 47, 0.8));
  animation: dare-phoenix 2s ease-out forwards;
}
@keyframes dare-phoenix {
  0%   { opacity: 0; transform: translateY(60px) scale(.5); }
  25%  { opacity: 1; }
  100% { opacity: 0; transform: translateY(-220px) scale(1.2); }
}

@media (max-width: 767px) {
  .dares-panel .panel__sub { display: block; font-size: .85rem; }
  .dares { padding: 0 10px 18px; }
  .dares__form {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "what" "due" "note" "go" "rules" "msg";
    padding: 0 12px 14px;
  }
  .dares__form-title { padding: 0 12px; }
  .dares__go { width: 100%; }
}

/* ---------- Меньше движения: огонь стоит, искры спрятаны ---------- */

@media (prefers-reduced-motion: reduce) {
  .spark { display: none; }
  .note__paper, .note__paper:hover, .note__paper:focus-within { transition: none; }
  .member__card, .member__card:hover { transition: none; transform: none; }
}
html.is-calm .spark { display: none; }
@media (prefers-reduced-motion: reduce) { .dare__fire > span { animation: none; } }
