/* Главная Руси по макету Kimi (porubezhye/design/landing-kimi, 31.10, Антон: «встраивай»).
   Разметка — web/home-rus.js. Только новый вид: класс rh-on на <html> ставит initRusHome при data-ui="v2",
   поэтому при ?ui=old ни одно правило здесь не срабатывает. Палитра с плаката: глубокая синева,
   янтарное золото, алый; шрифты — Ruslan Display (заглавие), PT Serif (разделы), PT Sans (текст).
   Новый вид один и тёмный (ui2.css) — светлой палитры макета здесь нет, кнопка темы спрятана, как везде в v2. */

/* Пока модули не дошли — прежнюю «Летопись» в новом виде не показываем (rh-off — главная не поднялась). */
:root[data-ui="v2"]:not(.rh-off) #scr-login > .ld { display: none; }

:root.rh-on {
  --rh-display: "Ruslan Display", "Triodion", Georgia, serif;
  --rh-head: "PT Serif", "Prata", Georgia, serif;
  --rh-body: "PT Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --rh-bg: #141210; --rh-bg-soft: #1b1815; --rh-panel: #24201c; --rh-line: #4a4238;
  --rh-bg-rgb: 20 18 16; --rh-panel-rgb: 36 32 28;
  /* 12.11: мелкий серый текст светлее — был #8d8267, контраст 4,2 при кегле 12,5–13,5. */
  --rh-ink: #f0ead8; --rh-dim: #c4b891; --rh-faint: #a89a7a;
  --rh-gold: #d9a441; --rh-gold-hi: #f0c66a; --rh-on-gold: #2a1c07;
  --rh-crimson: #a63226; --rh-crimson-hi: #bf4433; --rh-teal: #2e5857;
  --rh-top-h: 58px;
}

/* ── Экраны: свой фон и шрифт, листаются сами ───────────────────────── */
:root.rh-on #scr-login.landing,
:root.rh-on #scr-lobby.hq {
  background: var(--rh-bg); color: var(--rh-ink);
  font: 16px/1.55 var(--rh-body);
  overflow-x: hidden; overflow-y: auto;
}
:root.rh-on #scr-lobby .hq-wrap { width: 100%; padding: 0; }
:root.rh-on #scr-lobby #lobby-error { margin: 12px auto 0; width: min(1160px, 100% - 32px); }
:root.rh-on #scr-lobby #lobby-content > .muted { width: min(1160px, 100% - 32px); margin: 24px auto; }
:root.rh-on .rh { min-width: 0; }
:root.rh-on .rh *, :root.rh-on .rh *::before, :root.rh-on .rh *::after { box-sizing: border-box; }
:root.rh-on .rh-wrap { width: min(1160px, 100%); margin: 0 auto; padding: 0 20px; }
:root.rh-on .rh h1, :root.rh-on .rh h2, :root.rh-on .rh h3 { font-family: var(--rh-head); font-weight: 700; color: var(--rh-ink); }
:root.rh-on .rh img { display: block; max-width: 100%; }
:root.rh-on .rh a { color: var(--rh-gold-hi); text-decoration: none; }
:root.rh-on .rh a:hover { text-decoration: underline; }
:root.rh-on .rh b { font-weight: 700; }
:root.rh-on .rh [data-rh-sect] { scroll-margin-top: calc(var(--rh-top-h) + 10px); }

/* ── Шапка: до входа своя (.rh-top), после входа — .hq-top в том же виде ── */
:root.rh-on .rh-top,
:root.rh-on #scr-lobby .hq-top {
  position: sticky; top: 0; z-index: 20;
  background: rgb(var(--rh-bg-rgb) / .92);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rh-line); box-shadow: none;
}
:root.rh-on .rh-top-in {
  display: flex; align-items: center; gap: 16px; min-height: var(--rh-top-h);
  width: min(1160px, 100%); margin: 0 auto; padding: 0 20px;
}
:root.rh-on #scr-lobby .hq-top {
  display: flex; align-items: center; gap: 12px; min-height: var(--rh-top-h);
  padding: 8px max(20px, calc((100% - 1160px) / 2 + 20px));
}
:root.rh-on .rh-brand { display: flex; align-items: center; gap: 10px; min-width: 0; flex: none; }
:root.rh-on .rh-mark,
:root.rh-on #scr-lobby .hq-brand::before {
  /* 12.11: знак игры — «Р» в гексе над рекой (иконка приложения), обрезан по самому гексу. */
  content: ""; flex: none; width: 32px; height: 32px;
  background: url("./img/app-icon-192.png?v=ffa1185dc2") center / 100% 100% no-repeat;
  clip-path: polygon(50% 1.5%, 92% 25.5%, 92% 74.5%, 50% 98.5%, 8% 74.5%, 8% 25.5%);
}
:root.rh-on .rh-brand-name,
:root.rh-on #scr-lobby .hq-brand {
  font: 400 21px/1.15 var(--rh-display); letter-spacing: .05em; color: var(--rh-ink); white-space: nowrap; text-shadow: none;
}
:root.rh-on #scr-lobby .hq-brand { flex: none; display: flex; align-items: center; gap: 10px; }
:root.rh-on .rh-nav { display: flex; flex-wrap: wrap; gap: 2px 4px; margin-inline: auto; min-width: 0; }
:root.rh-on .rh-nav button,
:root.rh-on .rh-plain {
  appearance: none; border: 0; background: none; cursor: pointer; padding: 6px 6px;
  font: 700 13.5px var(--rh-body); text-transform: uppercase; letter-spacing: .05em; color: var(--rh-dim);
  text-decoration: none; white-space: nowrap;
}
:root.rh-on .rh-nav button:hover, :root.rh-on .rh-plain:hover { color: var(--rh-gold-hi); text-decoration: none; }
/* Разделы, которым не хватило места (длинное имя игрока), уходят целиком во вторую, скрытую строку,
   а не режутся посередине под «Графикой» («ЗАЛ С…», 08.11). Все разделы есть и ниже, на самой главной. */
:root.rh-on #scr-lobby .hq-top .rh-nav { flex-wrap: wrap; gap: 0; height: 28px; overflow: hidden; }
:root.rh-on #scr-lobby .hq-top .rh-nav button { padding: 6px 5px; font-size: 12.5px; letter-spacing: .04em; }
:root.rh-on .rh-switches { display: flex; align-items: center; gap: 8px; margin-left: auto; flex: none; }
/* «Лепо | Быстро» — сегмент, выбранное горит золотом. */
:root.rh-on .rh-top .lite-toggle,
:root.rh-on #scr-lobby .hq-top .lite-toggle {
  display: inline-flex; margin: 0; padding: 0; min-height: 30px; height: 30px; overflow: hidden;
  border-radius: 8px; border: 1px solid var(--rh-line); background: var(--rh-panel); clip-path: none; box-shadow: none;
}
:root.rh-on .rh-top .lite-toggle > span,
:root.rh-on #scr-lobby .hq-top .lite-toggle > span {
  display: flex; align-items: center; padding: 0 11px; color: var(--rh-dim); box-shadow: none;
  font: 700 12.5px var(--rh-body); text-transform: uppercase; letter-spacing: .05em;
}
:root.rh-on .rh-top .lite-toggle[aria-pressed="false"] .lt-on,
:root.rh-on .rh-top .lite-toggle[aria-pressed="true"] .lt-off,
:root.rh-on #scr-lobby .hq-top .lite-toggle[aria-pressed="false"] .lt-on,
:root.rh-on #scr-lobby .hq-top .lite-toggle[aria-pressed="true"] .lt-off { background: var(--rh-gold); color: var(--rh-on-gold); }
/* Колокольчик и имя игрока — в тех же плашках. */
:root.rh-on #scr-lobby .hq-top .home-bell,
:root.rh-on #scr-lobby .hq-top .menu-user summary {
  min-height: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--rh-line);
  background: var(--rh-panel); color: var(--rh-dim); clip-path: none; box-shadow: none;
}
:root.rh-on #scr-lobby .hq-top .home-bell { width: 32px; padding: 0; display: inline-flex; align-items: center; justify-content: center; flex: none; }
:root.rh-on #scr-lobby .hq-top .home-bell .ui-i { width: 18px; height: 18px; }
:root.rh-on #scr-lobby .hq-top .home-bell:hover, :root.rh-on #scr-lobby .hq-top .menu-user summary:hover { color: var(--rh-gold-hi); }
/* Имя игрока уступает место первым: на 600–640 px шапка иначе не влезает. */
:root.rh-on #scr-lobby .hq-top .menu-user { min-width: 0; flex: 0 1 auto; }
:root.rh-on #scr-lobby .hq-top .menu-user summary {
  display: flex; align-items: center; padding: 0 10px; max-width: min(170px, 100%); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font: 700 13.5px var(--rh-body); text-transform: uppercase; letter-spacing: .04em;
}

/* ── Панорама с входом ─────────────────────────────────────────────── */
:root.rh-on .rh-hero { position: relative; overflow: hidden; }
:root.rh-on .rh-hero-bg { position: absolute; inset: 0; background: #1b1f26 url("./img/landing/hero.webp?v=ffa1185dc2") center 30% / cover no-repeat; }
:root.rh-on .rh-hero-veil {
  position: absolute; inset: 0;
  /* 12.11: слева темнее — подзаголовок лежал на самом ярком месте заката и не читался. */
  background:
    linear-gradient(to right, rgba(8, 10, 14, .62) 0%, rgba(8, 10, 14, .34) 38%, rgba(8, 10, 14, 0) 68%),
    linear-gradient(to bottom, rgba(8, 10, 14, .30) 0%, rgba(8, 10, 14, .10) 35%, rgba(8, 10, 14, .82) 100%);
}
:root.rh-on .rh-hero-in {
  position: relative; z-index: 1; display: flex; flex-direction: column; justify-content: flex-end;
  min-height: 560px; padding-top: 72px; padding-bottom: 46px;
}
:root.rh-on .rh-title { margin: 0 0 12px; }
:root.rh-on .rh-what {
  max-width: 620px; margin: 0 0 22px; font: 400 16px/1.5 var(--rh-body); color: #e6dcc4;
  text-shadow: 0 1px 6px rgba(0, 0, 0, .75);
}
:root.rh-on .rh-title > span { display: block; }
:root.rh-on .rh-title-top {
  color: #f0c66a; font: 700 14px var(--rh-body); text-transform: uppercase; letter-spacing: .22em;
  text-shadow: 0 1px 6px rgba(0, 0, 0, .6);
}
:root.rh-on .rh .rh-title-main {
  font: 400 clamp(34px, 7vw, 88px)/1.1 var(--rh-display); letter-spacing: .02em; color: #f6e7c1;
  text-shadow: 0 2px 14px rgba(0, 0, 0, .65), 0 0 46px rgba(217, 164, 65, .25);
  overflow-wrap: anywhere;
}
:root.rh-on .rh-title-sub {
  margin-top: 10px; font: 400 clamp(16px, 2.2vw, 20px)/1.4 var(--rh-head); color: #f3ead4;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .9), 0 0 14px rgba(0, 0, 0, .7);
}
/* Панель входа на панораме. */
:root.rh-on .rh-gate {
  max-width: 480px; padding: 18px; border-radius: 14px;
  background: rgb(var(--rh-bg-rgb) / .74); border: 1px solid var(--rh-line); color: var(--rh-ink);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  display: flex; flex-direction: column; gap: 10px;
}
:root.rh-on .rh-gate .ld-form, :root.rh-on .rh-gate .ld-providers { gap: 10px; }
:root.rh-on .rh-gate .ld-label,
:root.rh-on .rh-label {
  display: block; margin: 0; font: 700 13px var(--rh-body); text-transform: uppercase; letter-spacing: .08em; color: var(--rh-dim);
}
:root.rh-on .rh-gate-row { display: flex; gap: 10px; }
:root.rh-on .rh-gate .ld-form input[type="text"],
:root.rh-on .rh .rh-input {
  flex: 1; min-width: 0; width: 100%; min-height: 44px; margin: 0; padding: 0 14px; border-radius: 10px;
  border: 1px solid var(--rh-line); background: var(--rh-bg-soft); color: var(--rh-ink);
  font: 16px var(--rh-body); box-shadow: none;
}
:root.rh-on .rh-gate .ld-form input[type="text"] { background: var(--rh-panel); }
:root.rh-on .rh input::placeholder { color: var(--rh-faint); }
:root.rh-on .rh-gate input:focus, :root.rh-on .rh .rh-input:focus { outline: 2px solid var(--rh-gold-hi); outline-offset: 1px; }
/* Кнопки: золото, алая главная и контур. */
:root.rh-on .rh .rh-btn,
:root.rh-on .rh-gate .ld-go {
  appearance: none; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 44px; margin: 0; padding: 0 18px; border-radius: 10px; border: 1px solid transparent; clip-path: none;
  font: 700 15px var(--rh-body); text-transform: none; letter-spacing: 0; white-space: nowrap; text-decoration: none;
}
:root.rh-on .rh .rh-btn:disabled, :root.rh-on .rh-gate .ld-go:disabled { opacity: .6; cursor: progress; }
:root.rh-on .rh .rh-btn-gold,
:root.rh-on .rh-gate .ld-go {
  background: linear-gradient(180deg, #f0c66a, #d9a441); color: #2a1c07; box-shadow: 0 2px 10px rgba(217, 164, 65, .35);
}
:root.rh-on .rh-gate .ld-go:hover, :root.rh-on .rh .rh-btn-gold:hover { filter: brightness(1.06); color: #2a1c07; text-decoration: none; }
/* 12.11: «Войти» рядом с красной «Играть» — тихая, контуром: главная кнопка на панели одна. */
:root.rh-on .rh-gate .ld-go.rh-quiet { background: transparent; color: var(--rh-gold-hi); border-color: var(--rh-line); box-shadow: none; }
:root.rh-on .rh-gate .ld-go.rh-quiet:hover { background: rgba(217, 164, 65, .16); color: var(--rh-gold-hi); filter: none; }
:root.rh-on .rh .rh-btn-primary {
  width: 100%; min-height: 52px; font-size: 17px;
  background: linear-gradient(180deg, var(--rh-crimson-hi), var(--rh-crimson)); color: #ffe9c9; box-shadow: 0 4px 16px rgba(166, 50, 38, .45);
}
:root.rh-on .rh .rh-btn-primary:hover { filter: brightness(1.08); }
:root.rh-on .rh-star { color: #f0c66a; }
:root.rh-on .rh .rh-btn-ghost { background: transparent; color: var(--rh-gold-hi); border-color: var(--rh-line); box-shadow: none; }
:root.rh-on .rh .rh-btn-ghost:hover { background: rgba(217, 164, 65, .16); }
:root.rh-on .rh .rh-btn-sm { min-height: 36px; padding: 0 14px; font-size: 14px; }
:root.rh-on .rh .rh-wide { width: 100%; }
:root.rh-on .rh-gate .ld-back { min-height: 40px; color: var(--rh-dim); font: 15px var(--rh-body); }
:root.rh-on .rh-gate .ld-step { margin: 0; font: 16px/1.5 var(--rh-body); color: var(--rh-ink); }
:root.rh-on .rh-gate .ld-step b { color: var(--rh-gold-hi); }
:root.rh-on .rh-gate .ld-note { display: none; }
:root.rh-on .rh-gate .ld-fine { display: block; margin: 0; font: 12.5px/1.4 var(--rh-body); color: var(--rh-faint); }
:root.rh-on .rh-gate .note-error { margin: 0; font: 15px/1.4 var(--rh-body); }
/* Способы входа: подпись и три кнопки в ряд. */
:root.rh-on .rh-gate .ld-providers { gap: 6px; }
:root.rh-on .rh-gate .ld-or {
  display: block; padding: 2px 0 0; font: 12.5px var(--rh-body); text-transform: uppercase; letter-spacing: .08em; color: var(--rh-faint);
}
:root.rh-on .rh-gate .ld-prov-grid { display: flex; flex-wrap: wrap; gap: 8px; }
:root.rh-on .rh-gate .ld-prov {
  flex: 1 1 100px; min-width: 0; min-height: 40px; margin: 0; padding: 0 10px; gap: 8px; justify-content: center;
  display: inline-flex; align-items: center; border-radius: 10px; border: 1px solid var(--rh-line);
  background: var(--rh-panel); color: var(--rh-ink); clip-path: none; box-shadow: none;
  font: 700 14px var(--rh-body); text-transform: none; letter-spacing: 0;
}
:root.rh-on .rh-gate .ld-prov[hidden] { display: none; }
:root.rh-on .rh-gate .ld-prov:hover { border-color: var(--rh-gold-hi); color: var(--rh-gold-hi); }
:root.rh-on .rh-gate .ld-prov-ico { width: 20px; height: 20px; }
:root.rh-on .rh-gate-more { display: flex; flex-direction: column; gap: 10px; margin-top: 2px; }
:root.rh-on .rh-gate-realm { margin: 0; font-size: 14.5px; color: var(--rh-dim); }
:root.rh-on .rh-gate-realm b, :root.rh-on .rh-hello b { color: var(--rh-gold-hi); }
:root.rh-on .rh-hello { margin: 0; font: 700 19px var(--rh-head); color: var(--rh-ink); }
:root.rh-on .rh .rh-link {
  appearance: none; border: 0; background: none; padding: 0; margin: 0; cursor: pointer; min-height: 0;
  font: inherit; color: var(--rh-gold-hi); text-decoration: underline; text-underline-offset: 2px;
}
:root.rh-on .rh-hint { margin: 0; font-size: 13.5px; line-height: 1.45; color: var(--rh-faint); }
:root.rh-on .rh-gate .rh-hint { color: #a8997a; }
:root.rh-on .rh .rh-botlevel {
  display: flex; align-items: center; gap: 10px; margin: 0; min-width: 0; font-size: 14px; color: var(--rh-dim);
}
:root.rh-on .rh .rh-botlevel .field-label { flex: none; margin: 0; color: var(--rh-dim); font: 700 12.5px var(--rh-body); text-transform: uppercase; letter-spacing: .06em; }
:root.rh-on .rh .rh-botlevel select {
  flex: 1 1 auto; min-width: 0; max-width: 100%; min-height: 38px; text-overflow: ellipsis;
  border-radius: 8px; border: 1px solid var(--rh-line); background: var(--rh-panel); color: var(--rh-ink); font: 14px var(--rh-body); padding: 0 8px;
  clip-path: none; box-shadow: none;
}
:root.rh-on .rh-gate-btns { display: flex; flex-wrap: wrap; gap: 8px; }
:root.rh-on .rh-gate-btns .rh-btn { flex: 1 1 120px; }
/* Статус хода, звание и карточка «Ваш ход» прежней главной — внутри панели. */
:root.rh-on .rh-status { display: grid; gap: 2px; font-size: 14.5px; color: var(--rh-dim); }
:root.rh-on .rh-status b { font: 700 18px var(--rh-head); color: var(--rh-ink); }
:root.rh-on .rh-gate .hq-rank { margin: -4px 0 0; font-size: 14px; color: var(--rh-dim); }
:root.rh-on .rh-gate .hq-rank b { font: 700 15px var(--rh-body); color: var(--rh-gold-hi); }
:root.rh-on .rh-gate .hq-link { color: var(--rh-gold-hi); font: inherit; }
:root.rh-on .rh-gate .hq-card { background: rgb(var(--rh-panel-rgb) / .9); border: 1px solid #6a5a3a; border-radius: 12px; box-shadow: none; padding: 12px; color: var(--rh-ink); }
:root.rh-on .rh-gate .hq-window { display: none; }
:root.rh-on .rh-gate .hq-window + .hq-head { margin-top: 0; padding: 0; }
:root.rh-on .rh-gate .hq-title { font: 700 19px var(--rh-head); color: var(--rh-ink); }
:root.rh-on .rh-gate .hq-kick { font: 700 12.5px var(--rh-body); text-transform: uppercase; letter-spacing: .08em; color: var(--rh-gold-hi); }
:root.rh-on .rh-gate .hq-sub, :root.rh-on .rh-gate .hq-line, :root.rh-on .rh-gate .hq-left { color: var(--rh-dim); font-family: var(--rh-body); }
:root.rh-on .rh-gate .hq-gold,
:root.rh-on #scr-lobby .hq-sticky .hq-gold {
  min-height: 46px; border: 0; border-radius: 10px; clip-path: none; box-shadow: 0 2px 10px rgba(217, 164, 65, .35);
  background: linear-gradient(180deg, #f0c66a, #d9a441); color: #2a1c07; font: 700 16px var(--rh-body);
}

/* ── Разделы ───────────────────────────────────────────────────────── */
:root.rh-on .rh-head { margin: 60px 0 22px; }
:root.rh-on .rh .rh-head h2 { margin: 0; font-size: clamp(26px, 3.6vw, 36px); line-height: 1.2; }
:root.rh-on .rh-head h2::after {
  content: ""; display: block; width: 64px; height: 3px; margin-top: 8px; border-radius: 2px;
  background: linear-gradient(90deg, var(--rh-gold), transparent);
}
:root.rh-on .rh-sub { margin: 8px 0 0; color: var(--rh-dim); font-size: 16px; }
:root.rh-on .rh-panel { min-width: 0; padding: 18px; border-radius: 14px; background: var(--rh-panel); border: 1px solid var(--rh-line); }
:root.rh-on .rh .rh-panel h3 { margin: 0 0 12px; font-size: 20px; }
:root.rh-on .rh .rh-panel h3 ~ h3 { margin-top: 18px; }
:root.rh-on .rh-empty { margin: 0; color: var(--rh-faint); }
:root.rh-on .rh .rh-more {
  display: inline-block; margin-top: 10px; padding: 4px 0; border: 0; background: none; cursor: pointer;
  font: 700 13.5px var(--rh-body); text-transform: uppercase; letter-spacing: .05em; color: var(--rh-gold-hi);
}
:root.rh-on .rh-more-line { margin: 16px 0 0; font-size: 15px; }

/* Столы */
:root.rh-on .rh-tables-grid { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 20px; align-items: start; }
:root.rh-on .rh-side { display: grid; gap: 20px; min-width: 0; }
:root.rh-on .rh-create { display: flex; flex-direction: column; gap: 12px; }
:root.rh-on .rh-create .rh-label { display: grid; gap: 6px; }
:root.rh-on .rh-join-row { display: flex; gap: 10px; }
:root.rh-on .rh .rh-code { flex: 1 1 auto; text-transform: uppercase; letter-spacing: .18em; text-align: center; font-weight: 700; }
:root.rh-on .rh-count {
  display: inline-block; min-width: 26px; padding: 1px 8px; border-radius: 999px; text-align: center; vertical-align: 2px;
  background: var(--rh-teal); color: #e8f4ef; font: 700 14px var(--rh-body);
}
:root.rh-on .rh-tlist { list-style: none; margin: 0; padding: 0; }
:root.rh-on .rh-trow { display: flex; align-items: center; gap: 12px; padding: 12px 10px; border-top: 1px solid var(--rh-line); }
:root.rh-on .rh-trow:first-child { border-top: 0; }
:root.rh-on .rh-trow:hover { background: rgba(217, 164, 65, .07); }
:root.rh-on .rh-trow-main { display: grid; min-width: 0; flex: 1; }
:root.rh-on .rh-trow-name { font-weight: 700; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
:root.rh-on .rh-trow-meta { color: var(--rh-faint); font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
:root.rh-on .rh-trow-code { font: 700 15px var(--rh-head); letter-spacing: .14em; color: var(--rh-gold-hi); }
/* Свои партии — строки прежней главной (hq-row) в цветах макета; новый вид рисует их «колодцами» — снимаем. */
:root.rh-on .rh .rh-mine { margin: 0 0 4px; gap: 0; }
:root.rh-on .rh .hq-list > li + li { border-top: 1px solid var(--rh-line); }
:root.rh-on .rh .hq-row, :root.rh-on .rh .hq-list > li.hq-row { background: none; box-shadow: none; clip-path: none; border-radius: 0; padding: 10px 0; color: var(--rh-ink); }
:root.rh-on .rh .hq-row-name { font: 700 16px var(--rh-head); color: var(--rh-ink); }
:root.rh-on .rh .hq-row:not(.is-wait) .hq-row-name { color: var(--rh-gold-hi); }
:root.rh-on .rh .hq-row-sub { color: var(--rh-faint); font-family: var(--rh-body); }
:root.rh-on .rh .hq-row:hover .hq-row-name { color: var(--rh-gold-hi); }
:root.rh-on .rh .hq-ok { color: var(--rh-gold-hi); }
/* Дружина — панель под «Создать стол». */
:root.rh-on .rh-druzhina .hq-sect { gap: 10px; }
:root.rh-on .rh-druzhina .hq-h2 { margin: 0; font: 700 20px var(--rh-head); letter-spacing: 0; text-transform: none; color: var(--rh-ink); display: block; }
:root.rh-on .rh-druzhina .hq-h2::after { display: none; }
:root.rh-on .rh-druzhina .hq-friend-name { font-family: var(--rh-body); font-weight: 700; color: var(--rh-ink); }
:root.rh-on .rh-druzhina .hq-friend-st, :root.rh-on .rh-druzhina .hq-note { color: var(--rh-faint); font-family: var(--rh-body); }
:root.rh-on .rh-druzhina .hq-friend-call { border-color: var(--rh-line); color: var(--rh-gold-hi); clip-path: none; background: none; box-shadow: none; border-radius: 12px; }
:root.rh-on .rh-druzhina .hq-friend-face.is-add { border-color: var(--rh-gold); color: var(--rh-gold-hi); }

/* Эпохи */
:root.rh-on .rh-epoch-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; align-items: stretch; }
:root.rh-on .rh .rh-epoch {
  appearance: none; cursor: pointer; text-align: left; margin: 0; min-width: 0;
  font: inherit; color: var(--rh-ink); background: var(--rh-panel);
  border: 2px solid var(--rh-line); border-radius: 14px; padding: 16px; clip-path: none; box-shadow: none;
  display: flex; flex-direction: column; gap: 6px;
}
:root.rh-on .rh .rh-epoch:hover { border-color: var(--rh-gold-hi); }
:root.rh-on .rh .rh-epoch.is-on { border-color: var(--rh-gold); box-shadow: 0 0 0 1px var(--rh-gold), 0 6px 20px rgba(217, 164, 65, .25); }
:root.rh-on .rh-epoch-era { font: 700 13px var(--rh-body); color: var(--rh-gold-hi); text-transform: uppercase; letter-spacing: .1em; }
:root.rh-on .rh-epoch-year { font: 700 26px var(--rh-head); }
:root.rh-on .rh-epoch-note { font-size: 14px; color: var(--rh-dim); line-height: 1.45; }
:root.rh-on .rh-seg { display: inline-flex; flex-wrap: wrap; max-width: 100%; border: 1px solid var(--rh-line); border-radius: 8px; overflow: hidden; background: var(--rh-bg-soft); }
:root.rh-on .rh .rh-seg button {
  appearance: none; border: 0; cursor: pointer; margin: 0; min-height: 34px; padding: 0 12px; clip-path: none; box-shadow: none;
  background: transparent; color: var(--rh-dim); font: 700 13px var(--rh-body); text-transform: uppercase; letter-spacing: .05em;
}
:root.rh-on .rh .rh-seg button.is-on { background: var(--rh-gold); color: var(--rh-on-gold); }
:root.rh-on .rh-epoch-end .rh-hint { margin-top: 10px; }

/* Полоса речного торга */
:root.rh-on .rh-ribbon { position: relative; margin: 56px 0 0; border-radius: 16px; overflow: hidden; border: 1px solid var(--rh-line); }
:root.rh-on .rh .rh-ribbon img { width: 100%; height: 300px; object-fit: cover; object-position: center 62%; }
:root.rh-on .rh-ribbon figcaption {
  position: absolute; left: 0; right: 0; bottom: 0; margin: 0; padding: 30px 22px 14px;
  background: linear-gradient(to top, rgba(8, 10, 14, .82), transparent);
  color: #eadfc6; font-size: 15px; font-style: italic;
}

/* Державы */
/* 12.11: все державы равными карточками (было шесть крупно и восемь кружками) — семь в ряд на широком экране. */
:root.rh-on .rh-realm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 14px; }
:root.rh-on .rh .rh-realm {
  appearance: none; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 0; margin: 0;
  padding: 10px 10px 12px; border-radius: 12px; text-align: center; clip-path: none;
  background: var(--rh-panel); border: 1px solid var(--rh-line); color: var(--rh-ink); font: inherit; box-shadow: none;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
:root.rh-on .rh .rh-realm:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0, 0, 0, .35); }
:root.rh-on .rh .rh-realm.is-on { border-color: var(--rh-gold); box-shadow: 0 0 0 2px var(--rh-gold) inset, 0 8px 24px rgba(0, 0, 0, .35); }
:root.rh-on .rh-realm-portrait { display: block; width: 100%; max-width: 220px; margin: 0 auto 8px; border-radius: 8px; overflow: hidden; border: 1px solid var(--rh-line); }
:root.rh-on .rh .rh-realm-portrait img { width: 100%; height: auto; aspect-ratio: 2 / 3; object-fit: cover; }
:root.rh-on .rh-realm-name { font: 700 17px/1.2 var(--rh-head); }
/* 12.11: имя правителя — спокойным цветом: золото оставлено действиям и ссылкам. */
:root.rh-on .rh-realm-ruler { color: var(--rh-dim); font-size: 13.5px; line-height: 1.3; }
:root.rh-on .rh-realm-note { color: var(--rh-faint); font-size: 13.5px; line-height: 1.35; }
/* Остальные державы — портреты-кружки в ряд. */
:root.rh-on .rh-chips { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
:root.rh-on .rh .rh-chip {
  appearance: none; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; margin: 0; min-width: 0;
  padding: 4px 14px 4px 4px; border-radius: 999px; border: 1px solid var(--rh-line); background: var(--rh-panel);
  color: var(--rh-ink); font: 700 14px var(--rh-body); clip-path: none; box-shadow: none;
}
:root.rh-on .rh .rh-chip img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; object-position: 50% 18%; }
:root.rh-on .rh .rh-chip:hover { border-color: var(--rh-gold-hi); }
:root.rh-on .rh .rh-chip.is-on { border-color: var(--rh-gold); box-shadow: 0 0 0 1px var(--rh-gold); color: var(--rh-gold-hi); }
/* Карточка выбранной державы (после входа): черта, свои отряды, «Играть за …». */
:root.rh-on .rh-pick { display: grid; gap: 12px; margin-top: 18px; padding: 18px; border-radius: 14px; background: var(--rh-panel); border: 1px solid var(--rh-line); }
:root.rh-on .rh .rh-pick .hq-pick { background: none; border: 0; padding: 0; box-shadow: none; color: var(--rh-ink); }
:root.rh-on .rh .rh-pick .hq-pick-title { font: 700 20px var(--rh-head); color: var(--rh-ink); }
:root.rh-on .rh .rh-pick .hq-sub, :root.rh-on .rh .rh-pick .hq-pick-text, :root.rh-on .rh .rh-pick dd { color: var(--rh-dim); font-family: var(--rh-body); }
:root.rh-on .rh .rh-pick dt { color: var(--rh-gold-hi); font-family: var(--rh-body); }
:root.rh-on .rh-pick > .rh-btn { justify-self: start; }

/* Как идёт партия */
/* Снимок настоящей карты партии (12.11): на главной видно саму игру. */
:root.rh-on .rh-shot { position: relative; margin: 0 0 18px; border-radius: 16px; overflow: hidden; border: 1px solid var(--rh-line); background: #c9b68a; }
:root.rh-on .rh .rh-shot img { width: 100%; height: auto; aspect-ratio: 12 / 7; object-fit: cover; }
:root.rh-on .rh-shot figcaption {
  position: absolute; left: 0; right: 0; bottom: 0; margin: 0; padding: 34px 20px 12px;
  background: linear-gradient(to top, rgba(8, 10, 14, .8), transparent);
  color: #f0e6cc; font-size: 15px; font-style: italic;
}
:root.rh-on .rh-chron-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
:root.rh-on .rh-chron-card { margin: 0; overflow: hidden; border-radius: 14px; background: var(--rh-panel); border: 1px solid var(--rh-line); }
:root.rh-on .rh .rh-chron-card img { width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; }
:root.rh-on .rh-chron-card figcaption { padding: 10px 14px 14px; font-size: 14.5px; color: var(--rh-dim); }

/* Что нового и Зал славы */
:root.rh-on .rh-duo { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
:root.rh-on .rh-duo > section { min-width: 0; }
:root.rh-on .rh-news, :root.rh-on .rh-hall { list-style: none; margin: 0; padding: 0; }
:root.rh-on .rh-news li, :root.rh-on .rh-hall li { border-top: 1px solid var(--rh-line); }
:root.rh-on .rh-news li:first-child, :root.rh-on .rh-hall li:first-child { border-top: 0; }
:root.rh-on .rh .rh-news a { display: grid; gap: 2px; padding: 10px 4px; color: var(--rh-ink); }
:root.rh-on .rh .rh-news a:hover { text-decoration: none; }
:root.rh-on .rh .rh-news a:hover .rh-news-title { color: var(--rh-gold-hi); }
:root.rh-on .rh-news-date { font-size: 12.5px; color: var(--rh-faint); text-transform: uppercase; letter-spacing: .06em; }
:root.rh-on .rh-news-title { font-weight: 700; font-size: 15.5px; }
:root.rh-on .rh-news-text { font-size: 14px; color: var(--rh-dim); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
:root.rh-on .rh-hall { counter-reset: hall; }
:root.rh-on .rh-hall li { counter-increment: hall; }
:root.rh-on .rh .rh-hall a { display: grid; grid-template-columns: 24px minmax(0, 1fr); column-gap: 12px; padding: 9px 4px; color: var(--rh-ink); }
:root.rh-on .rh .rh-hall a:hover { text-decoration: none; }
:root.rh-on .rh .rh-hall a::before { content: counter(hall); grid-row: span 2; font: 700 16px var(--rh-head); color: var(--rh-gold-hi); text-align: right; }
:root.rh-on .rh .rh-hall a:hover .rh-hall-name { color: var(--rh-gold-hi); }
:root.rh-on .rh-hall-name { font-weight: 700; font-size: 15.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
:root.rh-on .rh-hall-meta { color: var(--rh-faint); font-size: 13.5px; }
:root.rh-on .rh-kind { font-weight: 400; font-size: 12px; color: var(--rh-faint); text-transform: uppercase; letter-spacing: .05em; }

/* Подвал с ночным станом */
:root.rh-on .rh-foot { position: relative; margin-top: 80px; overflow: hidden; }
:root.rh-on .rh-foot-bg { position: absolute; inset: 0; background: #12141a url("./img/landing/camp.webp?v=ffa1185dc2") center 40% / cover no-repeat; filter: brightness(.9); }
:root.rh-on .rh-foot-in {
  position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 18px; align-items: center;
  width: 100%; padding: 54px max(20px, calc((100% - 1160px) / 2 + 20px));
  background: linear-gradient(to bottom, rgba(8, 10, 14, .55), rgba(8, 10, 14, .78));
}
:root.rh-on .rh-foot .rh-brand-name { color: #f6e7c1; }
:root.rh-on .rh-foot-brand p { margin: 4px 0 0; color: #d8c9a8; font-size: 14px; }
:root.rh-on .rh-foot-links { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-left: auto; }
:root.rh-on .rh .rh-foot-links a,
:root.rh-on .rh .rh-foot-links button {
  appearance: none; border: 0; background: none; padding: 4px 0; margin: 0; cursor: pointer; min-height: 0; clip-path: none; box-shadow: none;
  color: #e6d3a8; font: 700 13.5px var(--rh-body); text-transform: uppercase; letter-spacing: .06em; text-decoration: none;
}
:root.rh-on .rh .rh-foot-links a:hover, :root.rh-on .rh .rh-foot-links button:hover { color: #f0c66a; }
:root.rh-on .rh-foot-ver { width: 100%; font-size: 12px; color: #9d8c6d; }
/* «Лепо | Быстро» до входа живёт в подвале (12.11). */
:root.rh-on .rh-foot-tools { display: flex; gap: 8px; width: 100%; }
:root.rh-on .rh-foot-tools:empty { display: none; }
:root.rh-on .rh-foot .lite-toggle {
  display: inline-flex; margin: 0; padding: 0; min-height: 30px; height: 30px; overflow: hidden;
  border-radius: 8px; border: 1px solid var(--rh-line); background: var(--rh-panel); clip-path: none; box-shadow: none;
}
:root.rh-on .rh-foot .lite-toggle > span {
  display: flex; align-items: center; padding: 0 11px; color: var(--rh-dim); box-shadow: none;
  font: 700 12.5px var(--rh-body); text-transform: uppercase; letter-spacing: .05em;
}
:root.rh-on .rh-foot .lite-toggle[aria-pressed="false"] .lt-on,
:root.rh-on .rh-foot .lite-toggle[aria-pressed="true"] .lt-off { background: var(--rh-gold); color: var(--rh-on-gold); }
/* Проба оттенков основы — плашка в углу (только на своей машине или по ?tones=1). */
.rh-tones {
  position: fixed; left: 12px; bottom: 12px; z-index: 60; display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  max-width: calc(100vw - 24px); padding: 8px 10px; border-radius: 12px;
  background: rgba(10, 10, 12, .88); border: 1px solid #5a5040; color: #d8ccb0; font: 700 12.5px "PT Sans", system-ui, sans-serif;
}
.rh-tones > span { text-transform: uppercase; letter-spacing: .06em; color: #a89a7a; }
.rh-tones button {
  appearance: none; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; min-height: 30px; padding: 0 10px 0 6px;
  border-radius: 8px; border: 1px solid #4a4238; background: transparent; color: #e8dcc0; font: inherit;
}
.rh-tones button i { width: 16px; height: 16px; border-radius: 4px; border: 1px solid rgba(255, 255, 255, .25); }
.rh-tones button[aria-pressed="true"] { border-color: #f0c66a; color: #f0c66a; }

/* Лёгкий вид: без размытия, теней и подскока. */
:root.rh-on[data-lite="1"] .rh-top, :root.rh-on[data-lite="1"] #scr-lobby .hq-top,
:root.rh-on[data-lite="1"] .rh-gate { backdrop-filter: none; -webkit-backdrop-filter: none; }
:root.rh-on[data-lite="1"] .rh-gate { background: rgb(var(--rh-bg-rgb) / .88); }
:root.rh-on[data-lite="1"] .rh .rh-realm, :root.rh-on[data-lite="1"] .rh .rh-btn { box-shadow: none; transition: none; }
:root.rh-on[data-lite="1"] .rh .rh-realm:hover { transform: none; }

/* ── Средние экраны: разделы в колонку, меню разделов — прячем ───── */
@media (max-width: 1239px) {
  :root.rh-on #scr-lobby .hq-top .rh-nav { display: none; }
}
@media (max-width: 940px) {
  :root.rh-on .rh-tables-grid { grid-template-columns: minmax(0, 1fr); }
  :root.rh-on .rh-chron-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  :root.rh-on .rh-duo { grid-template-columns: minmax(0, 1fr); }
  :root.rh-on .rh-nav { display: none; }
}
/* Телефон: шапка в две строки — имя игры, под ним переключатели и ссылки. */
@media (max-width: 600px) {
  :root.rh-on { --rh-top-h: 92px; }
  /* До входа шапка — одна строка: знак, имя игры и «Изборник» (12.11, «Лепо | Быстро» ушло в подвал). */
  :root.rh-on #scr-login { --rh-top-h: 52px; }
  :root.rh-on .rh-top .rh-top-in { flex-wrap: nowrap; }
  :root.rh-on .rh-top .rh-brand { flex: 1 1 auto; }
  :root.rh-on .rh-top .rh-switches { flex: none; margin-left: auto; }
  :root.rh-on .rh-realm-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  :root.rh-on .rh .rh-realm { padding: 6px 6px 8px; }
  :root.rh-on .rh-realm-ruler { font-size: 12.5px; }
  :root.rh-on .rh-what { font-size: 15px; margin-bottom: 16px; }
  :root.rh-on #scr-login .rh-hero-in { padding-top: 56px; }
  :root.rh-on .rh-shot figcaption { font-size: 13.5px; padding: 26px 12px 8px; }
  :root.rh-on .rh-wrap { padding: 0 14px; }
  :root.rh-on .rh-top-in { flex-wrap: wrap; gap: 6px 10px; padding: 8px 14px; }
  :root.rh-on .rh-brand { flex: 1 0 100%; }
  :root.rh-on .rh-switches { flex: 1 0 100%; margin-left: 0; gap: 6px; }
  :root.rh-on .rh-switches .lite-toggle { margin-right: auto !important; }
  :root.rh-on .rh-plain { font-size: 12.5px; padding: 4px 4px; letter-spacing: .03em; }
  :root.rh-on #scr-lobby .hq-top { flex-wrap: wrap; gap: 6px 8px; padding: 8px 14px; }
  :root.rh-on #scr-lobby .hq-top .hq-brand { flex: 1 0 100%; }
  :root.rh-on #scr-lobby .hq-top .lite-toggle { margin-right: auto; }
  :root.rh-on #scr-lobby .hq-top .menu-user { flex: 0 1 auto; min-width: 0; }
  :root.rh-on #scr-lobby .hq-top .menu-user summary { max-width: 110px; padding: 0 6px; font-size: 12.5px; }
  :root.rh-on .rh-brand-name, :root.rh-on #scr-lobby .hq-brand { font-size: 18px; }
  :root.rh-on .rh-top .lite-toggle > span, :root.rh-on #scr-lobby .hq-top .lite-toggle > span { padding: 0 8px; font-size: 11.5px; }
  :root.rh-on .rh-hero-in { min-height: 0; padding-top: 110px; padding-bottom: 28px; }
  :root.rh-on .rh-gate { max-width: none; padding: 14px; }
  :root.rh-on .rh-chron-grid { gap: 12px; }
  :root.rh-on .rh-realm-name { font-size: 14.5px; }
  :root.rh-on .rh .rh-ribbon img { height: 200px; }
  :root.rh-on .rh-trow { flex-wrap: wrap; gap: 6px 12px; padding: 12px 4px; }
  :root.rh-on .rh-trow-main { flex: 1 1 100%; }
  :root.rh-on .rh-trow .rh-btn { margin-left: auto; }
  :root.rh-on .rh-head { margin-top: 44px; }
  :root.rh-on .rh-foot-links { margin-left: 0; }
  :root.rh-on .rh .rh-botlevel { flex-wrap: wrap; }
  :root.rh-on .rh .rh-botlevel select { flex-basis: 100%; }
}
@media (max-width: 360px) {
  :root.rh-on .rh-gate-row { flex-wrap: wrap; }
  :root.rh-on .rh-gate-row .ld-go { flex: 1 1 100%; }
  :root.rh-on .rh-hero-in { padding-top: 64px; }
  :root.rh-on .rh-brand-name, :root.rh-on #scr-lobby .hq-brand { font-size: 16px; }
  :root.rh-on .rh-plain { font-size: 11.5px; padding: 4px 2px; }
}
/* Телефон после входа: «Изборник» — в подвале, на узком и «Профиль» уходит в меню под именем. */
@media (max-width: 760px) {
  :root.rh-on #scr-lobby .hq-top a.rh-plain { display: none; }
}
@media (max-width: 420px) {
  :root.rh-on #scr-lobby .hq-top .rh-plain { display: none; }
}
/* Телефон лёжа (~800×360, Safari с полосами ~800×265): панорама ниже, вход плотнее. */
@media (max-height: 460px) and (orientation: landscape) {
  /* Шапка — снова в одну строку: лёжа высота дороже ширины. */
  :root.rh-on .rh-top-in { flex-wrap: nowrap; padding: 4px 20px; }
  :root.rh-on .rh-brand { flex: none; }
  :root.rh-on .rh-switches { flex: none; margin-left: auto; }
  :root.rh-on .rh-switches .lite-toggle { margin-right: 0 !important; }
  :root.rh-on #scr-lobby .hq-top { flex-wrap: nowrap; padding: 4px 20px; }
  :root.rh-on #scr-lobby .hq-top .hq-brand { flex: none; }
  :root.rh-on #scr-lobby .hq-top .lite-toggle { margin-left: auto; margin-right: 0; }
  :root.rh-on .rh-wrap { padding: 0 20px; }
  :root.rh-on .rh-hero-in { min-height: 0; padding-top: 16px; padding-bottom: 16px; }
  :root.rh-on .rh-title { margin-bottom: 10px; }
  :root.rh-on .rh .rh-title-main { font-size: clamp(28px, 5vw, 40px); }
  :root.rh-on .rh-title-top { font-size: 12px; }
  :root.rh-on .rh-title-sub { margin-top: 4px; font-size: 15px; }
  :root.rh-on .rh-gate { max-width: none; padding: 12px 14px; gap: 8px; }
  :root.rh-on .rh-gate .ld-form { gap: 8px; }
  :root.rh-on .rh-gate-more { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: 8px 12px; }
  :root.rh-on .rh .rh-gate-more .rh-btn-primary { min-height: 44px; font-size: 15px; }
  :root.rh-on .rh-gate .ld-fine { display: none; }
  :root.rh-on .rh .rh-ribbon img { height: 200px; }
  :root.rh-on .rh-top-in, :root.rh-on #scr-lobby .hq-top { min-height: 48px; }
  :root.rh-on { --rh-top-h: 48px; }
}
@media (max-height: 300px) and (orientation: landscape) {
  :root.rh-on .rh-title-sub, :root.rh-on .rh-title-top, :root.rh-on .rh-what { display: none; }
  :root.rh-on .rh-hero-in { padding-top: 10px; }
}

/* Липкая «Ходить» на телефоне — на фоне главной, не зелени нового вида. */
:root.rh-on #scr-lobby .hq-sticky { background: linear-gradient(180deg, rgb(var(--rh-bg-rgb) / 0), var(--rh-bg) 35%); }
