/* Временная вёрстка до настоящего интерфейса: экраны под компьютер, на телефоне не разваливается. */
/* Темы. Цвета подобраны под зелёных человечков из assets/ (#A9B05A, тень #6C7234).
   Без выбора тема как в системе: светлая «Небо» или тёмная «Сумерки». Выбор в шапке
   ставит data-theme на <html> (theme.js) и запоминается в браузере. */
:root, :root[data-theme="sky"] {
  --bg: #EEF4FA; --card: #FFFFFF; --text: #17212B; --muted: #5D6B79; --accent: #2F6FB2;
  --accent-text: #FFFFFF; --line: #D5E1EC; --soft: #E3EDF7; --error: #B3261E;
  --green: #A9B05A; --green-text: #24201C;
  --head: #16324F; --head-text: #FFFFFF; --head-line: #16324F; --head-soft: #24476B;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg: #0F1A2A; --card: #172538; --text: #E6EDF5; --muted: #93A3B5; --accent: #6CB4EE;
    --accent-text: #0F1A2A; --line: #26384F; --soft: #1F3048; --error: #F2B8B5;
    --head: #0A1320; --head-text: #E6EDF5; --head-line: #26384F; --head-soft: #172538;
    color-scheme: dark;
  }
}
:root[data-theme="dusk"] {
  --bg: #0F1A2A; --card: #172538; --text: #E6EDF5; --muted: #93A3B5; --accent: #6CB4EE;
  --accent-text: #0F1A2A; --line: #26384F; --soft: #1F3048; --error: #F2B8B5;
  --head: #0A1320; --head-text: #E6EDF5; --head-line: #26384F; --head-soft: #172538;
  color-scheme: dark;
}
:root[data-theme="teal"] {
  --bg: #F1F7F6; --card: #FFFFFF; --text: #1B2826; --muted: #5E706D; --accent: #138A8A;
  --accent-text: #FFFFFF; --line: #D3E4E2; --soft: #E2F0EE; --error: #B3261E;
  --head: #0E5257; --head-text: #FFFFFF; --head-line: #0E5257; --head-soft: #1A6A70;
  color-scheme: light;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.45 system-ui, sans-serif; }
/* тонкие полосы прокрутки без стрелок, в цвет темы (лента вопросов, чат, окна). Chrome, Edge и Safari —
   через ::-webkit-scrollbar; стандартное свойство только там, где их нет (Firefox): в Chrome оно
   перебило бы их и вернуло стрелки */
@supports not selector(::-webkit-scrollbar) {
  * { scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--muted) 45%, transparent) transparent; }
}
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--muted) 45%, transparent); border-radius: 3px; }
::-webkit-scrollbar-button { display: none; width: 0; height: 0; }
main { max-width: 440px; margin: 24px auto 48px; padding: 0 16px; }

/* шапка: отдельная полоса во всю ширину, внутри по центру человечек, имя и выбор темы */
.top { background: var(--head); color: var(--head-text); border-bottom: 1px solid var(--head-line); }
.top-inner { display: flex; align-items: center; gap: 12px; max-width: 1100px; margin: 0 auto; padding: 10px 16px; }
/* логотип (вариант A из docs/design/logo.html): округлый Nunito, «Olive» цветом фигурки.
   Шрифт лежит файлом рядом (только латиница, лицензия OFL в fonts/OFL.txt), без Google */
@font-face { font-family: "Nunito Logo"; src: url("fonts/nunito-900.woff2") format("woff2"); font-weight: 900; font-display: swap; }
.top a.brand { display: flex; align-items: center; gap: 9px; color: var(--head-text); text-decoration: none;
               font: 900 26px/1 "Nunito Logo", system-ui, sans-serif; letter-spacing: -.01em; }
.top a.brand .olive { color: #A9B05A; }
/* знак: голова фигурки с прищуром в кружке, как аватар в профиле (docs/design/logo-wink.html, вариант 1) */
.top a.brand img.logo { width: 40px; height: 40px; border-radius: 50%; background: var(--head-soft); }
.top img { height: 40px; }
.theme-pick { display: flex; align-items: center; gap: 8px; margin: 0 0 0 auto; color: var(--head-text); font-size: 16px; font-weight: 600; }
.top select { width: auto; padding: 6px 10px; font-size: 14px; font-weight: 400; background: var(--head-soft); color: var(--head-text); border-color: transparent; }
main.wide { max-width: 1100px; margin-top: 24px; }
h1 { font-size: 28px; margin: 0 0 24px; }
h1 a { color: inherit; text-decoration: none; }
section { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 20px; margin-bottom: 16px; }
h2 { font-size: 17px; margin: 0 0 12px; }
label { display: block; margin: 10px 0 4px; color: var(--muted); font-size: 14px; }
input[type=text], input[type=search], input[type=password], input[type=number], select, textarea {
  width: 100%; padding: 9px 10px; border: 1px solid var(--line); border-radius: 6px;
  background: var(--bg); color: var(--text); font: inherit;
}
.check { display: flex; gap: 8px; align-items: center; margin: 12px 0; color: var(--text); }
.check input { width: auto; }
button { padding: 9px 16px; border: 0; border-radius: 8px; font-weight: 600; background: var(--accent); color: var(--accent-text); font: inherit; cursor: pointer; }
button.plain { background: transparent; color: var(--accent); border: 1px solid var(--line); font-weight: 500; }
button.small { padding: 3px 10px; font-size: 13px; }
button:disabled { opacity: .5; cursor: default; }
.error { color: var(--error); min-height: 1.4em; margin: 8px 0 0; font-size: 14px; }
/* пустое место под ошибку не раздвигает карточку */
.error:empty { display: none; }
.muted { color: var(--muted); font-size: 14px; }
ul { list-style: none; padding: 0; margin: 0; }
li { padding: 8px 0; border-top: 1px solid var(--line); font-size: 14px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
li:first-child { border-top: 0; }
a { color: var(--accent); }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 12px; }
.row > input { flex: 1; min-width: 0; }
.tag { font-size: 12px; padding: 1px 7px; border-radius: 10px; background: var(--soft); color: var(--muted); }
/* галочка подтверждённого аккаунта: кружок цвета акцента, высотой с букву */
.verified { display: inline-block; width: .9em; height: .9em; margin-left: .25em; vertical-align: -0.08em; }
.verified svg { display: block; width: 100%; height: 100%; }
.verified circle { fill: var(--accent); }
.verified path { fill: none; stroke: var(--accent-text); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
/* корона в строке текста: высотой с букву */
.crown { height: 1em; width: auto; vertical-align: -0.1em; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--line); margin-right: 6px; }
.dot.on { background: var(--green); }
.code { font-family: ui-monospace, monospace; letter-spacing: .12em; }
[hidden] { display: none !important; }

/* комната */
.room { display: grid; grid-template-columns: 320px 1fr; gap: 16px; align-items: start; }
@media (max-width: 760px) { .room { grid-template-columns: 1fr; } }
/* лобби: низ левой колонки и чата на одной линии. Растягивается нижняя карточка слева («Раунд»),
   а если левая выше (у ведущего или на низком экране) — чат. Раньше у не-ведущего левая была короче */
body:not(.in-game) .room { align-items: stretch; }
body:not(.in-game) .room > div:first-child, body:not(.in-game) .room > .side { display: flex; flex-direction: column; }
body:not(.in-game) #play { flex: 1 0 auto; display: flex; flex-direction: column; }
.play-act { display: grid; gap: 10px; }
/* настройки комнаты в лобби: таймер и как передаётся Глава */
.play-info { display: grid; gap: 6px; padding: 9px 12px; border-radius: 12px; background: var(--soft); font-size: 13.5px; line-height: 1.3; }
.play-info > div { display: flex; align-items: center; gap: 9px; }
.play-info .pi-ic { width: 22px; height: 22px; flex: none; display: grid; place-items: center; color: var(--muted); }
.play-info .pi-ic .ic { width: 19px; height: 19px; }
.play-info .pi-ic img { height: 22px; }
.play-head .pi-edit { margin: 0; padding: 3px 10px; font-size: 13px; }
/* последнее в карточке (группа «Начать игру» и подсказка) — посередине свободного места под заголовком и счётом */
body:not(.in-game) #play > :last-child:not(:first-child) { margin-top: auto; margin-bottom: auto; }
body:not(.in-game) .side .chat { flex: 1 0 auto; }
@media (max-width: 760px) { body:not(.in-game) #play, body:not(.in-game) .side .chat { flex: none; } }
.chat { display: flex; flex-direction: column; height: calc(100vh - 392px); min-height: 380px; }

/* скамья: табуретки по числу мест в игре во всю ширину, на свободную садится вошедший */
.bench { padding: 16px 20px 12px; }
.bench h2 { margin: 0; }
.bench-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.bench-tools { display: flex; gap: 8px; flex-wrap: wrap; }
.rules-btn { display: inline-flex; align-items: center; gap: 7px; margin: 0; font-weight: 600; }
.rules-btn .ic { width: 17px; height: 17px; }
.seats { display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px; justify-items: center; }
@media (max-width: 900px) { .seats { grid-template-columns: repeat(5, 1fr); row-gap: 10px; } }
.seat { position: relative; width: 100%; max-width: 104px; display: flex; flex-direction: column; align-items: center; border-radius: 10px; }
.seat.taken:not(.me) { cursor: pointer; }
.seat:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.seat .pic { position: relative; width: 100%; height: 88px; }
.seat .pic img { position: absolute; left: 50%; bottom: 0; height: 100%; transform: translateX(-50%); transition: transform .15s; }
/* фигурка нарисована вместе с тем же табуретом, поэтому пустой под ней прячется */
.seat.taken .stool { visibility: hidden; }
.seat.taken:not(.me):hover .fig { transform: translate(-50%, -3px); }
/* зашёл — падает на табурет вытянутым, плюх: сплющился, табурет присел, пыль (docs/design/seat-landing.html, 2).
   --since — сколько уже падает (room.js): перерисовка скамьи продолжает падение, а не начинает заново */
.seat.landing .stool { visibility: visible; transform-origin: 50% 100%; animation: land-stool .75s linear var(--since, 0s) both; }
.seat.landing .fig { transform-origin: 50% 68%; animation: land .75s linear var(--since, 0s) both; }
@keyframes land {
  0%   { transform: translate(-50%, -100px) scale(.88, 1.16); opacity: 0; animation-timing-function: cubic-bezier(.5, 0, 1, .6); }
  8%   { opacity: 1; }
  45%  { transform: translate(-50%, 0) scale(.88, 1.16); animation-timing-function: ease-out; }
  56%  { transform: translate(-50%, 0) scale(1.24, .76); animation-timing-function: ease-in-out; }
  70%  { transform: translate(-50%, 0) scale(.94, 1.07); }
  84%  { transform: translate(-50%, 0) scale(1.04, .97); }
  100% { transform: translate(-50%, 0); }
}
@keyframes land-stool { 0%, 45% { transform: translateX(-50%); } 56% { transform: translateX(-50%) scale(1.05, .9); }
  70% { transform: translateX(-50%) scale(.98, 1.03); } 100% { transform: translateX(-50%); } }
.seat .puff { position: absolute; bottom: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--muted); opacity: 0; pointer-events: none;
  animation: land-puff .6s ease-out calc(var(--since, 0s) + .33s) both; }
.seat .puff.l { left: 22%; --dx: -16px; } .seat .puff.r { right: 22%; --dx: 16px; }
@keyframes land-puff { 0% { opacity: 0; } 1% { opacity: .5; transform: translate(0, 0) scale(.4); } 100% { opacity: 0; transform: translate(var(--dx), -10px) scale(1.4); } }
@media (prefers-reduced-motion: reduce) { .seat.landing .fig, .seat.landing .stool { animation: none; } .seat .puff { display: none; } }
.seat.offline .fig { filter: grayscale(.85) opacity(.55); }
/* ник: не шире места, до двух строк, длинное слово без пробелов тоже рвётся, лишнее многоточием */
.seat .label { margin-top: 6px; width: 100%; min-height: calc(2.5em + 16px); font-size: 14px; }
.seat .name { width: 100%; font-size: 14px; line-height: 1.25; text-align: center;
              display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; hyphens: auto; }
/* галочка не переносится одна; на узком экране склейка распирала бы колонку скамьи, там ник и так режется */
@media (min-width: 901px) { .seat .name .glue { white-space: nowrap; } }
.seat .name.free { color: var(--muted); opacity: .7; font-size: 13px; }
.seat.me .name { font-weight: 700; }
.seat .sub { font-size: 11px; color: var(--muted); line-height: 14px; margin-top: 2px; text-align: center; }
/* меню игрока облачком с хвостиком над ним (docs/design/seat-menu.html, вариант 7); --shift сдвигает облачко
   от края окна (fitSeatMenu в room.js), хвостик при этом остаётся над игроком */
.seat-menu { position: absolute; top: 48px; left: 50%; transform: translateX(calc(-50% + var(--shift, 0px))); z-index: 5; min-width: 240px; cursor: default;
             background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.18); text-align: left; }
.seat-menu::before { content: ""; position: absolute; top: -7px; left: calc(50% - var(--shift, 0px)); width: 12px; height: 12px; transform: translateX(-50%) rotate(45deg);
                     background: var(--card); border-left: 1px solid var(--line); border-top: 1px solid var(--line); }
.seat-menu .sm-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.seat-menu .sm-ava { flex: none; position: relative; width: 38px; height: 38px; border-radius: 50%; background: var(--soft); overflow: hidden; }
.seat-menu .sm-ava img { position: absolute; left: 50%; top: 3px; height: 62px; transform: translateX(-50%); }
.seat-menu .sm-who { min-width: 0; display: grid; gap: 1px; }
.seat-menu .sm-who b { font-size: 15px; line-height: 1.2; overflow-wrap: anywhere; }
.seat-menu .sm-who small { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); }
.seat-menu .sm-list, .seat-menu .sm-danger { padding: 6px; }
.seat-menu .sm-danger { border-top: 1px solid var(--line); border-radius: 0 0 13px 13px; background: color-mix(in srgb, var(--error) 6%, transparent); }
.seat-menu .glue { white-space: nowrap; }
.seat-menu .sm-ico { display: inline-block; width: 1.4em; margin-right: 6px; text-align: center; }
.seat-menu button, .seat-menu a { display: block; width: 100%; white-space: nowrap; text-align: left; background: transparent; color: var(--text);
                    font-weight: 500; font-size: 14px; padding: 8px 10px; border-radius: 6px; text-decoration: none; }
.seat-menu button:hover, .seat-menu a:hover { background: var(--soft); }
.seat-menu button.danger { color: var(--error); }
.seat-menu .sm-danger button:hover { background: color-mix(in srgb, var(--error) 10%, transparent); }
.start { display: grid; gap: 6px; }
.start button { width: 100%; }
.messages { flex: 1; overflow-y: auto; padding-right: 4px; }
/* журнал комнаты в чате: «Вася заходит в комнату» — серым курсивом по центру */
.message.system { text-align: center; color: var(--muted); font-style: italic; font-size: 13px; }
/* начало раунда — черта через весь чат с надписью посередине */
.message.round-start { display: flex; align-items: center; gap: 10px; margin: 14px 0 6px; font-style: normal; font-weight: 600; }
.message.round-start::before, .message.round-start::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.message { padding: 6px 0; font-size: 15px; overflow-wrap: anywhere; }
.message .who { font-weight: 600; margin-right: 6px; }
.message.private { color: var(--accent); }
.message time { color: var(--muted); font-size: 12px; margin-left: 6px; }
.compose { display: grid; grid-template-columns: 160px 1fr auto; gap: 8px; margin-top: 12px; }
/* «Кому» спрятан (в лобби один, или идёт раунд): его колонка не остаётся, иначе поле сжималось до 160px, а кнопка растягивалась */
.compose:has(> select[hidden]) { grid-template-columns: 1fr auto; }
@media (max-width: 520px) { .compose { grid-template-columns: 1fr; } }
.settings-grid { display: grid; grid-template-columns: 1fr 90px; gap: 6px 10px; align-items: center; font-size: 14px; }
.settings-grid input[type=number] { padding: 5px 8px; }
.notice { padding: 14px 16px; border-radius: 8px; background: var(--soft); margin-bottom: 16px; }

/* окно поверх страницы */
dialog.modal { border: 1px solid var(--line); border-radius: 12px; padding: 0; overflow: visible; width: min(380px, calc(100vw - 32px)); background: var(--card); color: var(--text); }
dialog.modal::backdrop { background: rgba(10, 20, 35, .55); }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.modal-head h2 { margin: 0; }
dialog.modal button[type=submit] { margin-top: 4px; }
dialog.modal form { padding: 20px; }

/* галочка в стиле полей: скруглённая, при отметке цвета кнопки с белой (в «Сумерках» тёмной) галкой */
input[type=checkbox] {
  appearance: none; -webkit-appearance: none; flex: none;
  width: 20px; height: 20px; margin: 0; border: 1.5px solid var(--line); border-radius: 6px;
  background: var(--bg) center / 13px 13px no-repeat; cursor: pointer;
  transition: background-color .12s, border-color .12s;
}
input[type=checkbox]:hover { border-color: var(--accent); }
input[type=checkbox]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
input[type=checkbox]:checked {
  background-color: var(--accent); border-color: var(--accent);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3 8.5l3.2 3L13 4.5' fill='none' stroke='%23FFFFFF' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
input[type=checkbox]:disabled { cursor: default; opacity: .6; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) input[type=checkbox]:checked {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3 8.5l3.2 3L13 4.5' fill='none' stroke='%230F1A2A' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  }
}
:root[data-theme="dusk"] input[type=checkbox]:checked {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3 8.5l3.2 3L13 4.5' fill='none' stroke='%230F1A2A' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.check { cursor: pointer; user-select: none; gap: 10px; }

/* блок комнаты: название игры, билет с кодом, меню «⋯» */
.room-top { display: grid; gap: 10px; }
.room-top p { margin: 0; }
.room-head { display: flex; align-items: center; gap: 4px; }
.room-head h2 { margin: 0; font-size: 21px; font-weight: 800; flex: 1; }
/* замочек в углу билета, напротив глазка, когда вход закрыт */
.lock-pill[hidden] { display: none; }
.bench-head h2 { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 8px; }
.lock-pill { display: inline-flex; align-items: center; gap: 5px; margin: 0 0 0 4px; padding: 4px 11px; border-radius: 999px; border: 1px solid transparent;
  background: var(--soft); color: var(--accent); font-size: 13px; font-weight: 700; line-height: 1; cursor: pointer; }
.lock-pill .ic { width: 14px; height: 14px; }
.lock-pill:not(:disabled):hover { border-color: var(--accent); }
/* «Открытая»: другой цвет, чтобы не путать с «Для своих» */
.lock-pill.public { background: #E3F4EA; color: #237A4B; }
:root[data-theme="dusk"] .lock-pill.public { background: #1F3A2C; color: #7FD6A4; }
@media (prefers-color-scheme: dark) { :root:not([data-theme]) .lock-pill.public { background: #1F3A2C; color: #7FD6A4; } }
.lock-pill:disabled { cursor: default; opacity: 1; }
.ticket { border: 2px dashed var(--line); border-radius: 12px; padding: 10px 14px 12px; text-align: center; position: relative; }
.ticket-label { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 2px 0 10px;
  display: flex; justify-content: center; align-items: center; gap: 6px; }
.ticket-label .help { width: 16px; height: 16px; font-size: 11px; letter-spacing: 0; text-transform: none; }
/* справка «?» у ссылки-приглашения: заголовок, список, абзац — по наведению или нажатию */
/* блок встаёт по центру рамки приглашения (.ticket), а не «?»: «?» правее центра, и на телефоне блок уезжал за край */
.help-wrap { display: inline-flex; }
.hint-pop { display: none; position: absolute; left: 50%; bottom: calc(100% - 6px); transform: translateX(-50%); z-index: 10;
  width: min(290px, calc(100vw - 32px)); padding: 10px 12px; border-radius: 8px; background: var(--text); color: var(--card); box-shadow: 0 6px 20px rgba(0,0,0,.18);
  font-size: 13px; font-weight: 400; line-height: 1.4; text-align: left; text-transform: none; letter-spacing: 0; }
.help-wrap:hover .hint-pop, .help:focus + .hint-pop { display: block; }
.hint-pop b { display: block; margin-bottom: 4px; }
.hint-list { display: grid; gap: 3px; margin: 0 0 6px; }
.hint-list:last-child { margin-bottom: 0; }
.hint-list span { position: relative; padding-left: 14px; }
.hint-list span::before { content: "•"; position: absolute; left: 3px; }
.ticket-label .help[data-hint]:hover::after, .ticket-label .help[data-hint]:focus::after { text-transform: none; letter-spacing: 0; }
.ticket-actions { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.ticket-invite { width: 100%; display: flex; white-space: nowrap; gap: 8px; justify-content: center; align-items: center; transition: background-color .25s, color .25s; }
/* «Скопировано»: кнопка сереет, галочка выпрыгивает */
.ticket-invite.copied { background: var(--muted); color: var(--card); }
.ticket-invite.copied .ic { animation: copied-pop .35s ease-out; }
@keyframes copied-pop { 0% { transform: scale(.4); } 70% { transform: scale(1.25); } 100% { transform: scale(1); } }
.ticket-qr { margin: 0; padding: 0 12px; display: grid; place-items: center; }
.qr-dialog { text-align: center; }
.qr-dialog form { padding: 16px 18px 18px; }
.qr-dialog img { display: block; margin: 6px auto 8px; width: 264px; height: 264px; max-width: 100%; border-radius: 10px; background: #fff; }
.qr-dialog p { margin: 0; }
.qr-dialog .qr-or { margin: 16px 0 12px; }
.ticket-renew { margin: 8px auto 0; display: block; font-size: 13px; padding: 3px 12px; }

/* иконки: векторные, цвет от текста кнопки */
.ic { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ibtn { width: 34px; height: 34px; padding: 0; display: inline-grid; place-items: center; background: transparent; color: var(--muted);
        border: 1px solid transparent; border-radius: 8px; font-weight: 400; }
.ibtn:hover { background: var(--soft); color: var(--accent); }
li .actions { display: flex; gap: 6px; align-items: center; }
li .ibtn { width: 30px; height: 30px; }

/* выпадающее меню */
.menu-wrap { position: relative; }

/* окно «Вы уже в комнате»: ссылка-кнопка «Вернуться» и «Выйти оттуда» */
a.button { display: inline-block; padding: 9px 16px; border-radius: 8px; font-weight: 600; background: var(--accent);
           color: var(--accent-text); text-decoration: none; }
.busy-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }
/* ссылка и кнопка одной высоты: у ссылки свои отступы строки, поэтому размеры заданы явно */
.busy-actions > a.button, .busy-actions > button { display: flex; align-items: center; justify-content: center; height: 44px; padding: 0 14px; margin: 0;
                   font-size: 15px; font-weight: 600; line-height: 1; white-space: nowrap; border-radius: 10px; }
@media (max-width: 420px) { .busy-actions { grid-template-columns: 1fr; } }
#busy-host:empty { display: none; }
#busy-dialog { width: min(460px, calc(100vw - 32px)); }
.busy-room { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-radius: 10px; background: var(--soft); margin: 14px 0 16px; }
.busy-room .busy-game { font-weight: 700; }
.busy-room .code { margin-left: auto; font-weight: 700; color: var(--accent); }
.busy-text { margin: 0 0 8px; }

/* главная: аккаунт и «Мои комнаты» */
.account h2 { margin: 0; overflow-wrap: anywhere; }
.account-status { margin: 2px 0 0; }
/* профиль в шапке: аватар с именем справа от темы, под ним меню */
.profile { position: relative; flex: none; }
.prof { display: flex; align-items: center; gap: 8px; padding: 3px 10px 3px 3px; border-radius: 26px; background: transparent;
        color: var(--head-text); font-weight: 600; font-size: 15px; }
.prof:hover, .prof[aria-expanded="true"] { background: var(--head-soft); }
.prof-name { display: inline-flex; align-items: center; min-width: 0; max-width: 160px; white-space: nowrap; }
.prof-name small { font-weight: 400; opacity: .75; font-size: 13px; }
.prof .caret { opacity: .7; font-size: 12px; }
.top .login-btn { background: var(--head-text); color: var(--head); }
/* аватар: голова своей фигурки в кружке; цвет фигурки потом выбирается в профиле */
.avatar { display: block; width: 36px; height: 36px; border-radius: 50%; background: var(--head-soft); overflow: hidden; position: relative; flex: none; }
.top .avatar img { position: absolute; left: 50%; top: 3px; height: 68px; transform: translateX(-50%); }
.avatar.lg { width: 56px; height: 56px; background: var(--soft); }
.top .avatar.lg img { height: 104px; top: 4px; }
.profile-menu { position: absolute; right: 0; top: calc(100% + 8px); z-index: 20; width: 270px; background: var(--card); color: var(--text);
                border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 14px 40px rgba(0,0,0,.2); padding: 8px; }
.profile-menu .who { display: flex; align-items: center; gap: 12px; padding: 6px 8px 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.profile-menu .who b { display: block; font-size: 16px; overflow-wrap: anywhere; }
.profile-menu .who span { color: var(--muted); font-size: 13px; }
.profile-menu [role=menuitem] { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: 8px; font-size: 14px;
                                font-weight: 500; background: transparent; color: var(--text); text-decoration: none; text-align: left; }
.profile-menu [role=menuitem]:hover:not(:disabled) { background: var(--soft); }
.profile-menu [role=menuitem]:disabled { opacity: 1; color: var(--muted); }
.profile-menu [role=menuitem][hidden] { display: none; }
.profile-menu .mi { width: 18px; text-align: center; font-size: 16px; color: var(--muted); }
.profile-menu .mt { flex: 1; }
.profile-menu small { color: var(--muted); font-size: 12px; font-family: inherit; letter-spacing: .04em; }
.profile-menu hr { border: 0; border-top: 1px solid var(--line); margin: 6px 0; }
@media (max-width: 640px) { .prof-name, .prof .caret { display: none; } .theme-pick { font-size: 0; gap: 0; } }

.wide-button { width: 100%; margin-top: 16px; }
.room-link { display: flex; align-items: center; gap: 10px; width: calc(100% + 16px); padding: 6px 8px; margin: -6px -8px; border-radius: 8px;
             color: var(--text); text-decoration: none; }
.room-link:hover { background: var(--soft); }
/* адреса комнаты в строке нет (он длинный и ничего не говорит): главное — игра */
.room-link .room-game { font-weight: 700; color: var(--accent); }
.room-link .room-game { flex: 1; }
.room-link .room-seats { color: var(--muted); font-size: 13px; }
.room-link .chev { color: var(--muted); font-size: 20px; line-height: 1; }
.menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 210px; background: var(--card); border: 1px solid var(--line);
        border-radius: 10px; box-shadow: 0 10px 30px rgba(0, 0, 0, .15); padding: 6px; z-index: 5; }
.menu button { display: flex; gap: 10px; align-items: center; width: 100%; white-space: nowrap; background: transparent; color: var(--text); font-weight: 500;
               padding: 8px 10px; border-radius: 6px; text-align: left; font-size: 14px; }
.menu button:hover { background: var(--soft); }
.menu button.danger { color: var(--error); }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }

/* всплывающее «скопировано» */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--text); color: var(--card);
         padding: 8px 14px; border-radius: 8px; font-size: 14px; opacity: 0; transition: opacity .2s; pointer-events: none; z-index: 20; }
.toast.show { opacity: 1; }

/* чат: в заголовке видно, кому пишешь */
.chat-head { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.chat-head h2 { margin: 0; }
/* глазик «скрыть чат» справа в заголовке; скрытый чат — плашка вместо сообщений (только компьютер) */
.chat-head .chat-eye { margin-left: auto; }
.chat-head .chat-eye[aria-pressed="true"] { color: var(--accent); }
.chat-veil { display: none; }
@media (min-width: 761px) {
  .chat.veiled .messages { display: none; }
  .chat.veiled .chat-veil { display: grid; flex: 1; place-content: center; justify-items: center; gap: 8px; color: var(--muted); font-size: 14px;
    border-top: 1px solid var(--line); text-align: center; }
}
@media (max-width: 760px) { .chat-head .chat-eye { display: none; } }
#chat-title.private { color: var(--accent); }
.message.private { cursor: pointer; }

/* окно настроек и подсказки под знаком вопроса */
dialog.modal-wide { width: min(560px, calc(100vw - 32px)); }
.settings-grid { grid-template-columns: 1fr 100px; gap: 10px 14px; }
.setting-label { display: flex; align-items: center; gap: 8px; }
.setting-label label { margin: 0; color: var(--text); font-size: 14px; }
/* настройка-выбор: карточки во всю ширину под подписью (docs/design/mayor-choice.html) */
.settings-grid .modes { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 4px; }
.modes label { display: grid; grid-template-columns: 22px 1fr; gap: 3px 8px; align-content: center; margin: 0; padding: 10px 12px; border-radius: 12px;
  border: 2px solid var(--line); cursor: pointer; font-size: 13px; line-height: 1.35; color: var(--muted); }
.modes label b { font-size: 14.5px; color: var(--text); }
.modes label span { grid-column: 2; }
.modes label.on { border-color: var(--accent); background: var(--soft); }
.modes input { margin: 0; grid-row: span 2; align-self: center; }
.modes input:disabled + b { opacity: .8; }
/* нечётная последняя карточка (уровень «Вперемешку») во всю ширину */
.settings-grid .modes label:last-child:nth-child(odd) { grid-column: 1 / -1; }
@media (max-width: 560px) { .settings-grid .modes { grid-template-columns: 1fr; } }
/* настроек больше, чем влезает в экран: окно прокручивается; подсказка «?» в нём сама выбирает,
   вверх или вниз открыться, чтобы край прокрутки её не обрезал (room.html, hintHelp) */
#settings-dialog { max-height: calc(100vh - 32px); overflow-y: auto; }
@supports (height: 100dvh) { #settings-dialog { max-height: calc(100dvh - 32px); } }
#settings .help-wrap { position: relative; vertical-align: middle; }
#settings .hint-pop { bottom: calc(100% + 6px); }
#settings .hint-pop.down { bottom: auto; top: calc(100% + 6px); }
.hint-p { display: block; }
.hint-p + .hint-p { margin-top: 4px; }
.hint-note { opacity: .7; font-size: 12px; }
.help {
  position: relative; flex: none; width: 18px; height: 18px; border-radius: 50%; display: inline-grid; place-items: center;
  font-size: 12px; font-weight: 700; color: var(--muted); border: 1px solid var(--line); cursor: help;
}
.help:hover, .help:focus { color: var(--accent); border-color: var(--accent); outline: none; }
/* подсказка только там, где есть текст (настройки комнаты); у «?» роли его нет — там окно по клику,
   а пустая плашка вылезала тёмной полосой */
.help[data-hint]:hover::after, .help[data-hint]:focus::after {
  content: attr(data-hint); position: absolute; left: 50%; bottom: calc(100% + 8px); transform: translateX(-50%);
  width: 260px; padding: 10px 12px; border-radius: 8px; background: var(--text); color: var(--card);
  font-size: 13px; font-weight: 400; line-height: 1.4; text-align: left; z-index: 10; box-shadow: 0 6px 20px rgba(0,0,0,.18);
}

/* --- партия «Тайного слова» ------------------------------------------------------------------ */
/* лобби и игра на одной странице: в лобби скамья, билет и панель старта, в игре стол во всю ширину */
.room > div:first-child { display: flex; flex-direction: column; min-width: 0; }
.side { display: flex; flex-direction: column; min-width: 0; }
.table-card { display: none; }
body.in-game main.wide, body.in-game .top-inner { max-width: 1800px; }
/* за столом высоту карточки считает secret_word.js (до низа окна минус 16px); нижний отступ страницы 48px
   добавлялся сверх неё, и страница выходила за экран */
body.in-game main.wide { margin-bottom: 0; }
/* лобби: снизу небольшой зазор вместо общих 48px — иначе при карточках во всю высоту окна
   появлялась прокрутка ровно на этот пустой отступ (живая проверка владельца 9 октября 2026) */
body.room-page:not(.in-game) main.wide { margin-bottom: 16px; }
body.in-game .bench, body.in-game .room-top, body.in-game #play { display: none; }
body.in-game .room { grid-template-columns: 1fr 380px; }
body.in-game .table-card { display: flex; position: relative; justify-content: center; align-items: flex-start; overflow: hidden; padding: 16px; margin-bottom: 0; }
body.in-game .side { gap: 12px; }
body.in-game .side .feed { flex: 1 1 0; height: auto; min-height: 0; margin: 0; }
body.in-game .side .chat { flex: 1 1 0; height: auto; min-height: 0; margin: 0; }
@media (max-width: 1100px) { body.in-game .room { grid-template-columns: 1fr; } body.in-game .side { height: auto !important; } body.in-game .side .feed, body.in-game .side .chat { flex: none; height: 360px; } }

.play { display: grid; gap: 10px; }
.play > * { margin: 0; }
.play p { margin: 0; }
/* лобби: карточке настроек — воздуха от заголовка и от «Начать игру» */
.play > .play-info { margin: 5px 0; }
.play button.wide { width: 100%; }
.play-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.play-head h2 { margin: 0; font-size: 19px; }
.timer { font: 700 24px/1 ui-monospace, monospace; color: var(--accent); padding: 4px 10px; border-radius: 8px; background: var(--soft); }
.timer.hurry { color: var(--error); }
.counters { display: grid; gap: 6px; }
/* сложность загаданного слова: плашка цвета уровня перед остатком жетонов */
.lvl { --lc: #5D6B79; display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: 13px; font-weight: 700;
       white-space: nowrap; color: var(--lc); background: color-mix(in srgb, var(--lc) 13%, transparent); }
.lvl .aa { font: 800 .9em/1 system-ui, sans-serif; opacity: .8; }
.lvl-easy { --lc: #2E8B57; } .lvl-medium { --lc: #2F6FB2; } .lvl-hard { --lc: #C76A1A; } .lvl-crazy { --lc: #8A4CC2; } .lvl-custom { --lc: #6F8A2E; }
:root[data-theme="dusk"] .lvl-medium { --lc: #6FA8E8; } :root[data-theme="dusk"] .lvl-crazy { --lc: #B98BE8; } :root[data-theme="dusk"] .lvl-mixed { --lc: #A9B6C2; }
.counters small { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.cnt-row { display: flex; flex-wrap: wrap; gap: 6px; }
/* остаток жетона: светлая плашка, значок и число цвета жетона */
.cnt { --c: var(--muted); display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px 3px 4px; border-radius: 999px; font-size: 13px;
       background: var(--soft); color: var(--text); }
.cnt .sign { width: 18px; height: 18px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 11px; font-weight: 800; background: var(--c); color: #fff; }
.cnt b { font-variant-numeric: tabular-nums; color: var(--c); font-size: 14px; }
.cnt-yes { --c: #2E8B57; }
/* цвета жетонов как в русском издании GaGa: «Может быть» синий «?», «Близко» жёлто-зелёный «!»,
   «Совсем не туда» тёмно-красный, «Верно» золотой со звездой */
.cnt-maybe { --c: #2F6FC0; }
.cnt-so_close { --c: #7E8C00; }
.cnt-way_off { --c: #8E2A38; }
:root[data-theme="dusk"] .cnt-maybe { --c: #6FA8E8; }
:root[data-theme="dusk"] .cnt-so_close { --c: #C8D84A; }
:root[data-theme="dusk"] .cnt-way_off { --c: #E58A96; }
.cnt.empty { opacity: .5; }

/* роль и слово: в режиме стримера размыты, пока не наведёшь */
.role-card { border-radius: 10px; padding: 12px 14px; background: var(--soft); border-left: 4px solid var(--muted); }
.role-card small, .role-mayor { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.role-mayor { color: var(--accent); font-weight: 700; }
.role-card .role-name { display: block; font-size: 22px; margin: 2px 0 4px; }
.role-card p { font-size: 14px; color: var(--muted); }
.role-card .role-wolves { color: var(--text); margin-top: 6px; }
.role-card.role-werewolf { border-left-color: #C0392B; }
.role-card.role-seer { border-left-color: #7D4CC2; }
.role-card.role-villager { border-left-color: var(--green); }
.word-plaque { border: 2px dashed var(--accent); border-radius: 10px; padding: 8px 12px; text-align: center; }
.word-plaque small { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.word-plaque b { font-size: 24px; overflow-wrap: anywhere; }
/* режим стримера: роль и слово размыты, открываются глазком рядом, не наведением */
.secret-wrap { position: relative; }
.secret { filter: blur(9px); user-select: none; }
.secret-wrap .secret-eye { position: absolute; top: 6px; right: 6px; z-index: 1; background: var(--card); border: 1px solid var(--line); }
.secret-wrap .secret-eye[aria-pressed="true"] { color: var(--accent); }
.big-word { font-size: 24px; font-weight: 800; text-align: center; overflow-wrap: anywhere; }
.call { font-weight: 600; }

/* выбор слова Главой */
.word-options { display: grid; gap: 8px; }
.word-options button { font-size: 17px; padding: 10px; }
.custom-word { display: grid; grid-template-columns: 1fr auto; gap: 8px; }

/* жетоны: цвет у плашки, значок одноцветный */
.tok { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 14px; font-size: 13px; font-weight: 600;
       color: #FFFFFF; background: #6B7280; white-space: nowrap; border: 0; line-height: 1.3; }
.tok .sign { font-weight: 800; }
.tok .count { font-weight: 800; margin-left: 2px; }
button.tok { cursor: pointer; padding: 6px 11px; }
button.tok:hover:not(:disabled) { filter: brightness(1.1); }
.tok-yes { background: #2E8B57; }
.tok-no { background: #C0392B; }
.tok-maybe { background: #2F6FC0; }
.tok-so_close { background: #B7C925; color: #2A3000; }
.tok-way_off { background: #7A2230; }
.tok-correct { background: #E2B23A; color: #3A2A00; }
.tok-row { display: flex; flex-wrap: wrap; gap: 6px; }
.free { border-top: 1px solid var(--line); padding-top: 10px; display: grid; gap: 8px; }
.free h3 { margin: 0; font-size: 15px; }
.free-to { display: flex; align-items: center; gap: 8px; margin: 0; }
.free-to select { width: auto; flex: 1; padding: 5px 8px; }

/* выбор игрока: кто Гадалка, кто Полукровка */
.pick-list { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.pick { background: transparent; color: var(--text); border: 1px solid var(--line); font-weight: 500;
        padding: 9px 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pick:hover { border-color: var(--accent); }
.pick.chosen { background: var(--accent); color: var(--accent-text); border-color: var(--accent); font-weight: 700; }
.oops-box { display: grid; gap: 6px; }
.oops-box select { width: auto; flex: 1; padding: 5px 8px; }

/* итог раунда */
.result { text-align: center; padding: 12px; border-radius: 10px; background: var(--soft); display: grid; gap: 6px; }
.result h2 { margin: 0; font-size: 24px; }
.result-village h2 { color: #2E8B57; }
.result-werewolves h2 { color: #C0392B; }
.verdict { justify-self: center; display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 800; line-height: 1; padding: 5px 12px; border-radius: 999px; }
.verdict svg { width: 15px; height: 15px; flex: none; }
/* «Вы победили» — золото, «Вы проиграли» — серо-голубое (docs/design/result-mood.html, A) */
.verdict.won { color: #3A2A00; background: linear-gradient(135deg, #FFE899, #E3AE2C 55%, #FFE08A); box-shadow: 0 0 0 2px rgba(255, 255, 255, .55), 0 2px 8px rgba(227, 174, 44, .45); }
.verdict.lost { color: #E9EEF5; background: linear-gradient(180deg, #6B7889, #4E5A6B); }
.roles li { font-size: 14px; }
.roles .tag { margin-left: 6px; }
.role-tag { font-size: 13px; font-weight: 600; }
.role-tag.role-werewolf { color: #C0392B; }
.role-tag.role-seer { color: #7D4CC2; }
.role-tag.role-villager { color: var(--muted); }

/* лента вопросов над чатом */
.feed { display: flex; flex-direction: column; height: 46vh; min-height: 300px; }
.feed-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.feed-head h2 { margin: 0; }
.questions { flex: 1; overflow-y: auto; padding-right: 4px; }
/* лента и чат отделены от шапки линией, уходящий вверх текст тает, а не обрезается по краю */
.questions, .messages { border-top: 1px solid var(--line); padding-top: 6px;
  -webkit-mask-image: linear-gradient(to bottom, #000 0 1px, transparent 1px, #000 15px); mask-image: linear-gradient(to bottom, #000 0 1px, transparent 1px, #000 15px); }
.q { padding: 8px 0; border-top: 1px solid var(--line); display: grid; gap: 6px; }
.q:first-child { border-top: 0; }
.q-line { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; font-size: 15px; overflow-wrap: anywhere; }
.q-line .who { font-weight: 600; }
.q-line .q-text { flex: 1; min-width: 40%; }
.questions .empty { padding: 8px 0; }
/* жетон за вопрос вслух строкой ленты: «Глава выдал игроку Вася жетон ✓ Да» */
.q.aloud .q-text { color: var(--muted); font-size: 14px; }
.q.aloud .q-text b { color: var(--text); font-weight: 600; }
/* мини-жетоны: под игроком за столом и «в центре стола» (docs/design/aloud-tokens.html, A) */
.tk-minis { display: flex; gap: 3px; justify-content: center; flex-wrap: wrap; margin-top: 3px; }
/* место за столом сжато scale(--k): на мелком столе кружок крупнее изнутри, чтобы на экране был не меньше 15px */
.tk-mini { display: inline-flex; align-items: center; gap: 1px; height: max(17px, calc(15px / var(--k, 1))); min-width: max(17px, calc(15px / var(--k, 1)));
  justify-content: center; padding: 0 5px; border-radius: 9px; font-size: max(11px, calc(10px / var(--k, 1))); font-weight: 800; line-height: 1; color: #fff; }
.tk-mini b { font-weight: 800; }
.tk-mini.tok-so_close, .tk-mini.tok-correct { color: #2A3000; }
.c-free { display: grid; gap: 2px; justify-items: center; margin-top: 4px; }
.c-free small { font-size: 10px; letter-spacing: .06em; text-transform: uppercase; opacity: .8; }
.ask { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-top: 10px; }

/* скамья во время раунда: Глава, вскрытые роли, голоса */
.seat .tags { display: flex; flex-wrap: wrap; justify-content: center; gap: 3px; margin-top: 3px; }
.seat-tag { font-size: 11px; line-height: 15px; padding: 0 6px; border-radius: 8px; background: var(--soft); color: var(--muted); white-space: nowrap; }
.seat-tag.mayor { background: var(--accent); color: var(--accent-text); font-weight: 700; }
/* порядочность ниже порога паузы (web/decency.py) */
.seat-tag.low-decency { background: #C0392B; color: #fff; font-weight: 700; }
:root[data-theme="dusk"] .seat-tag.low-decency { background: #D9534F; }
.seat-tag.role-werewolf { background: #C0392B; color: #FFFFFF; }
.seat-tag.role-seer { background: #7D4CC2; color: #FFFFFF; }
.seat-tag.role-villager { background: var(--line); color: var(--text); }
.seat.watching .fig { filter: opacity(.45); }
/* ушёл посреди раунда: бледный призрак и зачёркнутое имя, до конца раунда место за ним */
.seat.gone .fig { filter: grayscale(1) opacity(.3); }
.seat.gone .name { color: var(--muted); text-decoration: line-through; }
/* медаль Главы на груди фигурки */
/* лента от шеи (65% высоты фигурки), медаль на груди между руками: в процентах, чтобы сидела на любом размере */
/* Глава на троне вместо табурета (assets/throne_*.png, 428×673). Фигурка в картинке того же размера, что
   обычная высотой 512, трон выше табурета: картинка выше в 673/512 = 1.3145 раза, низ трона на уровне низа
   табурета, голова на 62/512 = 12.1% выше обычной */
.seat .pic .fig.throne { height: 131.45%; }
.seat .pic.on-throne .stool { display: none; }
/* пауза: просьба сверху панели, кнопка просьбы скромно внизу */
.pause-vote { display: grid; gap: 8px; padding: 12px; border-radius: 10px; border: 2px solid var(--accent); background: var(--soft); }
.pause-vote .play-head b { font-size: 15px; }
.timer.small { font-size: 16px; padding: 2px 8px; background: var(--card); }
.pause-ask { justify-self: start; }
.seat.pointed .pic::after, .seat.picked .pic::after { content: ""; position: absolute; inset: auto 18% -4px; height: 4px; border-radius: 2px; background: #C0392B; }
.seat.picked .pic::after { background: var(--accent); }

/* --- игровой стол (вариант E) ---------------------------------------------------------------- */
.table-card .corner { position: absolute; z-index: 3; top: 14px; }
.table-card .corner.tl { left: 16px; width: 270px; }
/* середина не заходит на карточку роли слева (270px) и кнопки справа: на узком столе текст переносится */
.table-card .corner.tc { left: 50%; transform: translateX(-50%); width: min(460px, calc(100% - 600px)); display: grid; gap: 8px; justify-items: center; text-align: center; }
.table-card .corner.tr { right: 16px; display: flex; gap: 4px; align-items: center; }
.table-card .corner.tc p { margin: 0; }
.g-call { font-weight: 700; font-size: 16px; }
/* тесно между плашкой роли и кнопками справа — мельче, но над центром стола (fitAction) */
.table-card .corner.tc.tight .g-call { font-size: 14px; }
.table-card .corner.tc.tight p.muted { font-size: 12.5px; line-height: 1.35; }
/* плашка роли, вариант C: фигурка роли в кружке её цвета, рядом роль и слово */
.g-role { --rc: var(--green); --rc-soft: var(--soft); display: grid; grid-template-columns: 64px 1fr; gap: 12px; align-items: center;
          padding: 10px 12px 10px 10px; border-radius: 14px; background: var(--rc-soft); }
.g-role.role-villager { --rc: #6C7234; --rc-soft: #EEF0DA; }
.g-role.role-seer { --rc: #7D4CC2; --rc-soft: #EEE6FA; }
.g-role.role-werewolf { --rc: #C0392B; --rc-soft: #FBE7E4; }
:root[data-theme="dusk"] .g-role.role-villager { --rc-soft: #2A3320; }
:root[data-theme="dusk"] .g-role.role-seer { --rc-soft: #2E2440; }
:root[data-theme="dusk"] .g-role.role-werewolf { --rc-soft: #3A2224; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .g-role.role-villager { --rc-soft: #2A3320; }
  :root:not([data-theme]) .g-role.role-seer { --rc-soft: #2E2440; }
  :root:not([data-theme]) .g-role.role-werewolf { --rc-soft: #3A2224; }
}
.g-role .ava { width: 64px; height: 64px; border-radius: 50%; border: 3px solid var(--rc); background: var(--card); overflow: hidden; position: relative; }
.g-role .ava img { position: absolute; left: 50%; top: 4px; height: 118px; transform: translateX(-50%); }
/* у Главы в кружке голова на фоне трона: высота в 1.3145 раза больше, голова там, где у обычной фигурки */
.g-role .ava img.throne { height: 155px; top: -19px; }
.g-role.role-villager .ava img.throne { height: 126px; top: -17px; }
/* у Жителя широкая шляпа: мельче, чтобы она влезла в кружок целиком */
.g-role.role-villager .ava img:not(.throne) { height: 96px; top: 2px; }
.g-role small { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.g-role b { display: block; font-size: 19px; color: var(--rc); line-height: 1.15; }
.g-role .g-word { font-size: 14px; margin-top: 2px; }
.g-role .g-word b { display: inline; font-size: 16px; color: var(--text); overflow-wrap: anywhere; }
.g-role .muted { font-size: 13px; }
/* подсказка «?» в верхнем углу стола открывается вниз, а не за край карточки */
.help.down[data-hint]:hover::after, .help.down[data-hint]:focus::after { top: calc(100% + 8px); bottom: auto; left: 0; transform: none; text-transform: none; letter-spacing: 0; }
.ask-mayor { font-size: 16px; padding: 11px 22px; border-radius: 12px; box-shadow: 0 6px 18px rgba(0,0,0,.12); display: grid; gap: 2px; }
.ask-mayor .arrow { font-size: 12px; font-weight: 500; opacity: .85; }
.table-card .free-to { display: flex; align-items: center; gap: 8px; margin: 0; }
.table-card .free-to select { width: auto; padding: 4px 8px; }
.table-card .tok-row { justify-content: center; }
.table-card .word-options { grid-template-columns: repeat(3, 1fr); width: 100%; }
.table-card .custom-word { width: 100%; }
.table-card .pick-list { width: 100%; }
.table-card .oops-box { justify-content: center; margin: 0; }
.table-card .oops-box select { width: auto; padding: 4px 8px; }
.table-card .pause-vote { width: 100%; text-align: left; }
#ask-dialog { width: min(460px, calc(100vw - 32px)); }
#ask-dialog textarea { min-height: 84px; resize: vertical; margin-top: 8px; }

.stage { position: relative; flex: none; }
.stage .tabletop { position: absolute; left: 0; top: 0; }
.stage .center { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); text-align: center; color: #F3EBDD;
                 display: grid; gap: 6px; justify-items: center; }
.stage .c-ph { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; opacity: .85; }
.stage .c-clock { font: 700 30px/1 ui-monospace, monospace; background: rgba(0, 0, 0, .28); padding: 6px 12px; border-radius: 10px; }
.stage .c-clock.hurry { color: #FFB4A8; }
.stage .c-word { background: #F3EBDD; color: #2A211A; border-radius: 8px; padding: 4px 12px; font-weight: 800; font-size: 20px; overflow-wrap: anywhere; }
.stage .c-note { font-size: 14px; opacity: .9; }
.stage .c-word-lab { font-weight: 600; font-size: .8em; opacity: .65; }
.stage .c-said .c-word-lab, .stage .c-said .c-word-text { display: block; }
.stage .c-said .c-word-lab { font-size: .65em; line-height: 1.3; }
/* длинное слово мельче: 13–18 знаков и больше 18 (wordSize в secret_word.js) */
.stage .c-word-text.w-long { font-size: .8em; }
.stage .c-word-text.w-xlong { font-size: .58em; }
.res-word b.w-long { font-size: 20px; }
.res-word b.w-xlong { font-size: 17px; }
/* «Слово угадано!», «Время вышло»: крупно и ярко, как «Победа Жителей», — главная новость за столом */
.stage .c-big { font-size: clamp(16px, calc(var(--cw, 300px) / 11), 24px); font-weight: 800; color: #FFE7A8; white-space: nowrap;
  text-shadow: 0 2px 6px rgba(0,0,0,.45); }
/* «Слово: …» после раунда: размер от ширины центра стола, чтобы помещалось в строку */
.stage .c-said { font-size: clamp(13px, calc(var(--cw, 300px) / 12), 20px); margin-top: 6px; } /* отступ от плашки «Вы победили» */
/* «Победа Полукровок» одной строкой: размер от ширины центра стола, от 16 до 26px */
.stage .c-result { font-size: clamp(16px, calc(var(--cw, 300px) / 10.5), 26px); font-weight: 800; white-space: nowrap; }
.stage .piles { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; }
.stage .piles .tok { font-size: 12px; padding: 2px 7px; }
.stage .verdict { justify-self: center; }

.g-seat { position: absolute; width: 104px; transform: translate(-50%, -50%) scale(var(--k, 1)); display: flex; flex-direction: column;
          align-items: center; text-align: center; background: transparent; color: var(--text); border: 0; padding: 0; font-weight: 400;
          border-radius: 10px; cursor: default; }
.g-seat.can-pick { cursor: pointer; }
.g-seat.can-pick:hover .fig { transform: translate(-50%, -4px); }
.g-seat.can-pick:hover .nm { color: var(--accent); }
.g-seat .pic { position: relative; height: 70px; width: 100%; }
.g-seat .pic .fig { position: absolute; left: 50%; bottom: 0; height: 100%; transform: translateX(-50%); transition: transform .15s; }
.g-seat .pic .fig.throne { height: 131.45%; }
/* ник до 20 символов: место под имя шире места фигуры, у Главы во главе стола — ещё шире */
.g-seat .nm { font-size: 13px; line-height: 1.2; margin-top: 3px; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.g-seat.big .nm { max-width: 220px; }
.g-seat.me .nm { font-weight: 700; }
.g-seat .tg { display: flex; gap: 3px; justify-content: center; flex-wrap: wrap; margin-top: 2px; min-height: 15px; }
/* пустая строка меток не отодвигает жетоны от ника */
.g-seat .tg:empty { display: none; }
.g-seat .tg span { font-size: 10.5px; line-height: 15px; padding: 0 6px; border-radius: 8px; background: var(--soft); color: var(--muted); white-space: nowrap; }
.g-seat .tg .mayor { background: var(--accent); color: var(--accent-text); font-weight: 700; }
.g-seat .tg .role-werewolf { background: #C0392B; color: #FFFFFF; }
.g-seat .tg .role-seer { background: #7D4CC2; color: #FFFFFF; }
.g-seat .tg .role-villager { background: var(--line); color: var(--text); }
.g-seat.big .pic { height: 90px; }
.g-seat.big .nm { font-size: 15px; }
.g-seat.offline .fig { filter: grayscale(.85) opacity(.55); }
.g-seat.gone .fig { filter: grayscale(1) opacity(.3); }
.g-seat.gone .nm { color: var(--muted); text-decoration: line-through; }
.g-seat.pointed .pic::after, .g-seat.picked .pic::after { content: ""; position: absolute; left: 22%; right: 22%; bottom: -3px; height: 4px; border-radius: 2px; background: #C0392B; }
.g-seat.picked .pic::after { background: var(--accent); }
/* чат в узкой колонке игры: «кому» отдельной строкой над полем */
body.in-game .compose { grid-template-columns: 1fr auto; }
body.in-game .compose select { grid-column: 1 / -1; }
.secret-wrap .g-role { padding-right: 44px; }

/* окно выбора слова у Главы: кто он, тайная роль, слова */
dialog.word-dialog { width: min(620px, calc(100vw - 32px)); }
/* не влезло в экран (телефон, длинная плашка роли) — прокрутка внутри окна, а не текст за рамкой */
dialog.word-dialog { max-height: calc(100vh - 32px); overflow-y: auto; }
@supports (height: 100dvh) { dialog.word-dialog { max-height: calc(100dvh - 32px); } }
.word-dialog form { display: grid; gap: 10px; }
.word-dialog .modal-head { gap: 10px; }
.word-dialog .modal-head h2 { flex: 1; font-size: 21px; }
.word-dialog h3 { margin: 6px 0 0; font-size: 16px; }
.word-dialog p { margin: 0; }
.word-dialog .word-lead { font-size: 15px; }
.word-dialog .word-options { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.word-dialog .word-options button { overflow-wrap: anywhere; }
/* уровень выбирает Глава: вкладки над вариантами слова */
.word-levels { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; padding: 4px; border-radius: 12px; background: var(--soft); }
.word-levels button { padding: 7px 4px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.word-levels button.on { background: var(--card); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
/* телефон: варианты слова столбиком — «безумные» длинные, вкладки мельче */
@media (max-width: 560px) {
  .word-dialog .word-options { grid-template-columns: 1fr; }
  .word-dialog .word-options button { padding: 8px 10px; font-size: 16px; }
  .word-levels button { font-size: 12.5px; padding: 7px 2px; }
  /* телефон: окно плотнее и мельче, чтобы целиком влезало в экран */
  .word-dialog form { padding: 16px; gap: 8px; }
  .word-dialog .modal-head h2 { font-size: 19px; }
  .word-dialog .word-lead { font-size: 14px; }
  .word-dialog .muted { font-size: 13px; }
  .word-dialog h3 { font-size: 15px; margin-top: 2px; }
}
.word-dialog .g-role .muted { font-size: 13px; margin-top: 2px; }
/* «Глава» в плашке роли: жирной плашкой цвета акцента, чтобы сразу было видно */
.g-role .mayor-pill { background: var(--accent); color: var(--accent-text); font-weight: 800; font-size: 12px; letter-spacing: .04em;
                      padding: 1px 8px; border-radius: 8px; }
.secret-wrap .secret-eye { width: 28px; height: 28px; }
.g-role small { white-space: nowrap; }
.g-role b.g-name { display: flex; align-items: center; gap: 8px; }
.g-role b.g-name .help { color: var(--muted); }
button.help { padding: 0; background: var(--card); font-size: 12px; font-weight: 700; line-height: 1; cursor: pointer; }
/* окно «Ваша роль» по «?» у плашки роли */
dialog.role-dialog { width: min(560px, calc(100vw - 32px)); }
.role-dialog form { display: grid; gap: 12px; }
.role-dialog .modal-head h2 { font-size: 21px; }
.role-sheet { --rc: var(--green); --rc-soft: var(--soft); display: grid; grid-template-columns: 124px 1fr; gap: 16px; align-items: center;
             padding: 16px; border-radius: 14px; background: var(--rc-soft); overflow: hidden; }
.role-sheet.role-villager { --rc: #6C7234; --rc-soft: #EEF0DA; }
.role-sheet.role-seer { --rc: #7D4CC2; --rc-soft: #EEE6FA; }
.role-sheet.role-werewolf { --rc: #C0392B; --rc-soft: #FBE7E4; }
:root[data-theme="dusk"] .role-sheet.role-villager { --rc-soft: #2A3320; }
:root[data-theme="dusk"] .role-sheet.role-seer { --rc-soft: #2E2440; }
:root[data-theme="dusk"] .role-sheet.role-werewolf { --rc-soft: #3A2224; }
/* фигура по центру своей колонки и по высоте плашки, с равными отступами (была прижата к низу и шире колонки) */
.role-sheet .role-fig { position: relative; height: 130px; justify-self: center; align-self: center; }
.role-sheet .role-fig img { height: 100%; display: block; }
.role-sheet .role-fig:has(.throne) { height: 160px; }
.role-sheet > div:last-child > b { display: block; font-size: 26px; color: var(--rc); line-height: 1.15; margin-top: 4px; }
.role-sheet .role-side { font-size: 14px; color: var(--muted); margin-top: 2px; }
.role-sheet .role-side b { color: var(--text); }
.role-sheet .mayor-pill { background: var(--accent); color: var(--accent-text); font-weight: 800; font-size: 12px; letter-spacing: .04em; padding: 1px 8px; border-radius: 8px; }
.role-row h3 { margin: 0 0 2px; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.role-row p { margin: 0; font-size: 15px; line-height: 1.45; }
/* обычный список с точками: общий стиль li (строки таблицей, с линиями) здесь не нужен */
.role-wins { margin: 0; padding-left: 20px; list-style: disc; font-size: 15px; line-height: 1.45; }
.role-wins li { display: list-item; padding: 0; border: 0; font-size: 15px; }
.role-wins li::marker { color: var(--muted); }
/* спрятанная роль: размытая обманка, одинаковая для всех ролей (docs/design/role-hidden.html, D) */
.g-role.role-decoy { filter: blur(9px); user-select: none; pointer-events: none; }
/* подсказка перед фазой: шапка цвета роли с фигуркой и часами (docs/design/prep-hint.html, B) */
dialog.prep-dialog { width: min(460px, calc(100vw - 32px)); max-height: calc(100vh - 32px); overflow-y: auto; overflow-x: hidden;
  --rc: #6C7234; }
@supports (height: 100dvh) { dialog.prep-dialog { max-height: calc(100dvh - 32px); } }
dialog.prep-dialog.prep-seer { --rc: #7D4CC2; }
dialog.prep-dialog.prep-werewolf { --rc: #C0392B; }
dialog.prep-dialog.prep-mayor { --rc: #B7791F; }
/* «Самозванец»: мирный оливковый, шпион тёмный, как его карточка; в скрытом режиме у всех одна шапка */
dialog.prep-dialog.prep-spy { --rc: #3A2F25; }
dialog.prep-dialog.prep-hidden { --rc: #4A6D8C; }
/* «Карточка на лбу»: ролей нет, шапка цвета сайта */
dialog.prep-dialog.prep-card { --rc: #2F6FB2; }
dialog.prep-dialog form { padding: 0; }
.prep-head { background: var(--rc); color: #FFFFFF; padding: 14px 18px 12px; display: flex; align-items: center; gap: 12px; border-radius: 11px 11px 0 0; }
.prep-head .ava { width: 66px; height: 66px; border-radius: 50%; background: rgba(255, 255, 255, .22); overflow: hidden; position: relative; flex: none; }
.prep-head .ava img { position: absolute; left: 50%; top: 4px; height: 120px; transform: translateX(-50%); }
.prep-head .ava img.throne { height: 158px; top: -19px; }
.prep-head .t { flex: 1; min-width: 0; }
.prep-head small { display: block; text-transform: uppercase; letter-spacing: .08em; font-size: 11px; opacity: .85; }
.prep-head b { display: block; font-size: 21px; line-height: 1.15; }
.prep-clock { font: 800 24px ui-monospace, Consolas, monospace; background: rgba(0, 0, 0, .22); border-radius: 10px; padding: 2px 10px; }
.prep-clock.hurry { color: #FFFFFF; }
.prep-body { padding: 12px 18px 16px; }
.prep-sub { color: var(--muted); font-size: 13.5px; margin: 0 0 6px; }
.fc-tips { margin: 0 0 12px; padding-left: 18px; font-size: 14px; line-height: 1.45; list-style: disc; }
.fc-tips li { display: list-item; margin: 0 0 4px; padding: 0; border: 0; }
.prep-text { position: relative; }
.prep-text ul { margin: 0; padding-left: 18px; font-size: 15px; line-height: 1.45; }
.prep-text ul { list-style: disc; }
.prep-text li { display: list-item; margin: 0 0 6px; padding: 0; border: 0; }
.prep-text li::marker { color: var(--rc); }
.prep-foot { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.prep-when { flex: 1; font-size: 13px; color: var(--muted); text-wrap: balance; }
.prep-foot button { flex: none; }
/* роль спрятана глазком: имя, фигурка и подсказка в мыле, сверху «Показать роль» */
.prep-dialog.hidden-role .prep-head .ava, .prep-dialog.hidden-role .prep-text ul { filter: blur(9px); user-select: none; }
.prep-dialog.hidden-role .prep-head { background: var(--muted); }
.prep-show { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); display: inline-flex; align-items: center; gap: 6px;
  background: var(--card); color: var(--text); border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; font-weight: 700; white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .15); }
@media (max-width: 760px) {
  .prep-head { padding: 12px 14px 10px; }
  .prep-head b { font-size: 18px; }
  .prep-head .ava { width: 54px; height: 54px; }
  .prep-head .ava img { height: 100px; }
  .prep-head .ava img.throne { height: 132px; top: -16px; }
  .prep-clock { font-size: 19px; }
  .prep-body { padding: 10px 14px 14px; }
  .prep-text ul { font-size: 14px; padding-left: 16px; }
  .prep-foot { flex-direction: column; align-items: stretch; }
  .prep-foot button { width: 100%; }
}
/* 3, 2, 1 перед фазой: одна крупная цифра поверх стола у всех; стол под ней темнее и размыт,
   надписи стола не спорят с цифрой */
.prep-count { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center;
  background: rgba(10, 20, 35, .7); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); color: #FFFFFF; pointer-events: none; }
.prep-count b { font: 900 140px/1 system-ui, sans-serif; text-shadow: 0 6px 30px rgba(0, 0, 0, .5); }
/* окно голосования «Кто Полукровка?»: игроки карточками, имя по центру */
dialog.vote-dialog { width: min(640px, calc(100vw - 32px)); }
/* окно никогда не выше экрана: на низком экране прокручивается */
dialog.vote-dialog { max-height: calc(100vh - 32px); overflow-y: auto; overflow-x: hidden; }
/* на телефоне 100vh выше видимой части (панель браузера), окно уезжало верхом за экран */
@supports (height: 100dvh) { dialog.vote-dialog { max-height: calc(100dvh - 32px); } }
/* больше шести карточек: окно шире, карточки ниже, пять в ряд — девять влезают в два ряда */
dialog.vote-dialog.many { width: min(760px, calc(100vw - 32px)); }
.vote-dialog.many .vote-grid { gap: 8px; }
.vote-dialog.many .vote-grid .vote-card { width: calc((100% - 4 * 8px) / 5); }
.vote-dialog.many .vote-card { padding: 8px 6px 8px; gap: 2px; }
.vote-dialog.many .vote-fig { height: 84px; }
.vote-dialog.many .vote-fig img { height: 64px; }
.vote-dialog.many .vote-fig img.throne { height: 84px; }
.vote-dialog.many .vote-name { font-size: 14px; }
.vote-dialog form { display: grid; gap: 14px; }
.vote-dialog .modal-head { gap: 10px; }
.vote-dialog .modal-head h2 { flex: 1; font-size: 22px; }
.vote-lead { margin: 0; font-size: 15px; }
/* карточки по центру, как в окне итога */
.vote-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.vote-grid .vote-card { width: calc((100% - 3 * 10px) / 4); }
.vote-card { display: grid; justify-items: center; align-content: start; gap: 4px; padding: 12px 8px 10px; border-radius: 14px; margin: 0;
             background: var(--soft); color: var(--text); border: 2px solid transparent; font-weight: 500; text-align: center;
             transition: transform .12s, border-color .12s, box-shadow .12s; }
.vote-card:hover:not(:disabled) { border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 6px 16px rgba(0,0,0,.12); }
.vote-card.chosen { border-color: var(--accent); background: var(--card); box-shadow: 0 0 0 3px var(--soft); }
.vote-card.gone .vote-fig { filter: grayscale(1) opacity(.4); }
/* место под фигурку с запасом под трон Главы: фигурки стоят по низу, у всех на одном уровне */
.vote-fig { position: relative; height: 121px; display: flex; align-items: flex-end; }
.vote-fig img { height: 92px; display: block; }
.vote-fig img.throne { height: 121px; }
.vote-name { font-size: 15px; font-weight: 700; line-height: 1.2; overflow-wrap: anywhere; }
.vote-tags { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; font-size: 12px; min-height: 18px; }
.vote-tags .mayor-pill { background: var(--accent); color: var(--accent-text); font-weight: 800; padding: 1px 8px; border-radius: 8px; }
.vote-mine { color: var(--accent); font-weight: 700; }
.vote-progress { display: grid; gap: 6px; }
.vote-progress p { margin: 0; font-size: 13px; text-align: center; }
.vote-bar { height: 6px; border-radius: 3px; background: var(--soft); overflow: hidden; }
.vote-bar i { display: block; height: 100%; background: var(--accent); transition: width .3s; }
.vote-oops { display: grid; gap: 8px; justify-items: center; padding-top: 12px; border-top: 1px solid var(--line); }
.vote-oops p { margin: 0; font-size: 14px; }
.vote-oops select { width: min(280px, 100%); text-align: center; text-align-last: center; }
.vote-oops button { width: min(280px, 100%); }
/* то же окно на поиске Гадалки: выбор красной рамкой, указания напарника видны */
.vote-dialog.hunt .vote-card.chosen { border-color: #C0392B; }
.vote-dialog.hunt .vote-card:hover:not(:disabled) { border-color: #C0392B; }
.vote-dialog.hunt .vote-mine { color: #C0392B; }
.vote-mate { color: #C0392B; font-weight: 600; }
.g-call.waiting { display: inline-flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 2px 6px; }
.wait-n { background: #C0392B; color: #fff; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; display: inline-grid; place-items: center; font-size: 13px; }
/* кольцо жетонов вокруг игрока у Главы (docs/design/mayor-panel.html, F2): дугой со стороны стола */
.tok-ring { position: absolute; width: 0; height: 0; z-index: 6; }
/* у Главы днём стол нажимается: «Совсем не туда» в центр стола */
.stage.can-center .tabletop { cursor: pointer; }
.ring-tok { position: absolute; width: 46px; height: 46px; margin: -23px; padding: 0; border-radius: 50%; display: grid; place-items: center;
            color: #fff; border: 2px solid #fff; box-shadow: 0 4px 12px rgba(0, 0, 0, .25); transform: scale(var(--k)); cursor: pointer;
            animation: ring-in .18s ease-out; transition: transform .12s; }
.ring-tok .s { font-size: 19px; font-weight: 800; line-height: 1; }
.ring-tok i { position: absolute; transform: translate(-50%, -50%); pointer-events: none; font-style: normal; font-size: 10.5px; font-weight: 700; white-space: nowrap;
              color: var(--text); background: var(--card); padding: 0 5px; border-radius: 6px; box-shadow: 0 1px 3px rgba(0, 0, 0, .15); }
.ring-tok:hover:not(:disabled) { transform: scale(calc(var(--k) * 1.12)); }
.ring-tok:disabled { opacity: .35; cursor: default; }
@keyframes ring-in { from { opacity: 0; transform: scale(calc(var(--k) * .4)); } }
@keyframes ring-fade { from { opacity: 0; } }
/* «Задать вопрос Главе», вариант E из docs/design/ask-button.html: светлая, без тени, как остальные кнопки сайта */
.ask-soft { display: inline-flex; align-items: center; gap: 8px; padding: 9px 18px; border-radius: 10px; font-size: 15px; font-weight: 600;
            background: var(--soft); color: var(--accent); border: 1px solid transparent; }
.ask-soft:hover:not(:disabled) { border-color: var(--accent); }
/* «Задать вопрос Главе» — главное действие игрока: обводка основным цветом, иначе терялась на фоне (владелец) */
.g-ask .ask-soft, #feed-ask, .sw-empty .ask-soft { border: 1.5px solid color-mix(in srgb, var(--accent) 60%, transparent); box-shadow: 0 2px 8px color-mix(in srgb, var(--accent) 18%, transparent); }
.g-ask .ask-soft:hover:not(:disabled), #feed-ask:hover:not(:disabled), .sw-empty .ask-soft:hover:not(:disabled) { border-color: var(--accent); }
.ask-sub { font-size: 13px; margin: 0; }
/* кнопка вопроса слева под плашкой роли, поверх пустого края стола */
.g-ask { position: absolute; left: 16px; z-index: 3; width: 270px; display: grid; gap: 5px; }
.g-ask .ask-soft { justify-content: center; width: 100%; }
.g-ask .ask-sub { text-align: center; }
.ask-soft .ic { width: 18px; height: 18px; }
/* та же кнопка поменьше в заголовке ленты вопросов */
.feed-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; }
.ask-soft.small { padding: 5px 12px; font-size: 13.5px; gap: 6px; }
.ask-soft.small .ic { width: 15px; height: 15px; }
/* окно итога раунда (docs/design/next-round.html, вариант B): шапка цвета победителя, слово, все роли */
dialog.result-dialog { width: min(600px, calc(100vw - 32px)); max-height: calc(100vh - 32px); overflow-y: auto; overflow-x: hidden; }
/* на телефоне 100vh выше видимой части (панель браузера), и верх окна уходил за экран */
@supports (height: 100dvh) { dialog.result-dialog { max-height: calc(100dvh - 32px); } }
.res-band { padding: 18px 20px 16px; text-align: center; color: #fff; background: #5B6470; border-radius: 12px 12px 0 0; }
.res-band.res-village { background: #2E8B57; }
.res-band.res-werewolves { background: #C0392B; }
/* причина конца под заголовком итога (осталось меньше двух игроков) */
.res-band .res-why { margin: -4px 0 8px; font-size: 14px; opacity: .9; }
.res-band small { display: block; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; opacity: .85; }
.res-band b { display: block; font-size: 28px; line-height: 1.15; margin: 2px 0 4px; }
.res-band span { font-size: 14px; opacity: .95; }
/* итог с настроением: победа — лучи, конфетти, золотая плашка; поражение — тусклая шапка, тучки, дождь
   (docs/design/result-mood.html, A и result-defeat.html, «Дождь») */
.res-band { position: relative; overflow: hidden; isolation: isolate; }
.res-band > small, .res-band > b, .res-band > span:not(.res-cloud) { position: relative; z-index: 3; }
.res-band > span:not(.res-plate):not(.res-cloud) { display: block; }
.res-band .res-plate { margin: 6px 0 8px; padding: 6px 16px; font-size: 16px; opacity: 1; }
.res-band .res-plate svg { width: 17px; height: 17px; }
.res-band .verdict.won { animation: res-pop .6s cubic-bezier(.3, 1.6, .5, 1) both, res-shine 2.4s ease-in-out .6s infinite; background-size: 200% 100%; }
@keyframes res-pop { from { transform: scale(.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes res-shine { 0%, 100% { background-position: 0 0; } 50% { background-position: 100% 0; } }
.res-rays { position: absolute; z-index: 0; left: 50%; top: 50%; width: 520px; height: 520px; margin: -260px 0 0 -260px; pointer-events: none;
  background: repeating-conic-gradient(rgba(255, 236, 160, .28) 0 9deg, transparent 9deg 22deg);
  -webkit-mask: radial-gradient(circle, #000 0 18%, transparent 62%); mask: radial-gradient(circle, #000 0 18%, transparent 62%);
  animation: res-spin 18s linear infinite; }
@keyframes res-spin { to { transform: rotate(360deg); } }
.res-confetti { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.res-confetti i { position: absolute; top: -12px; width: 7px; height: 11px; border-radius: 2px; opacity: 0; animation: res-fall 2.6s cubic-bezier(.3, .6, .6, 1) forwards; }
@keyframes res-fall { 0% { opacity: 1; transform: translateY(0) rotate(0); } 85% { opacity: 1; } 100% { opacity: 0; transform: translateY(190px) rotate(540deg); } }
/* залп победы из плашки (winBurst): на весь экран поверх окна итога, нажатиям не мешает */
.win-burst { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 10; pointer-events: none;
  margin: 0; padding: 0; border: 0; background: transparent; max-width: none; max-height: none; overflow: hidden; }
dialog.result-dialog.bump { animation: res-bump .5s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes res-bump { 0% { transform: scale(.96); } 60% { transform: scale(1.02); } 100% { transform: scale(1); } }
.res-band.mood-lost { animation: res-dim 1.6s ease-out forwards; }
@keyframes res-dim { to { filter: saturate(.6) brightness(.86); } }
.res-rain { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.res-rain i { position: absolute; top: -24px; width: 1.6px; border-radius: 1px; background: linear-gradient(180deg, rgba(220, 234, 255, 0), rgba(220, 234, 255, .75));
  transform: rotate(14deg); animation: res-rainfall linear infinite; }
@keyframes res-rainfall { from { translate: 0 0; } to { translate: -46px 190px; } }
/* тучи плывут через небо (docs/design/result-clouds.html, 2): слой во всю ширину шапки сдвигается от «туча
   целиком слева за краем» до «за правым краем», поэтому на любой ширине окна путь один; движение равномерное */
.res-cloud { position: absolute; left: 0; width: 100%; z-index: 2; pointer-events: none; will-change: transform;
  animation: res-float var(--t, 50s) linear var(--d, 0s) infinite; }
.res-cloud svg { display: block; width: var(--w); }
@keyframes res-float { from { transform: translate3d(calc(var(--w) * -1), 0, 0); } to { transform: translate3d(100%, 0, 0); } }
.res-band .verdict.lost { transform-origin: 12% 50%; animation: res-sag 1.8s cubic-bezier(.35, 0, .25, 1) .5s both; }
@keyframes res-sag { 0% { transform: rotate(0); } 70% { transform: rotate(-3deg); } 100% { transform: rotate(-2.5deg); } }
@media (prefers-reduced-motion: reduce) {
  .res-rays, .res-cloud, .res-rain i, .res-band.mood-lost, .res-band .verdict { animation: none !important; }
  /* тучи стоят разбросанными по небу, а не кучей у левого края */
  .res-cloud { transform: translate3d(calc(var(--w) * -1 + (100% + var(--w)) * var(--p, .5)), 0, 0); }
  .res-confetti, .res-rain { display: none; }
  .res-band.mood-lost { filter: saturate(.6) brightness(.86); }
}
.res-body { padding: 14px 20px 18px; display: grid; gap: 14px; }
.res-word { text-align: center; font-size: 14px; color: var(--muted); }
.res-word b { display: block; font-size: 24px; color: var(--text); overflow-wrap: anywhere; }
/* карточки по центру: при любом числе игроков ряд ровный, без пустого места сбоку */
.res-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.res-card { width: 104px; }
.res-card { display: grid; justify-items: center; align-content: start; gap: 3px; padding: 8px 4px 8px; border-radius: 12px; background: var(--soft);
            text-align: center; border: 2px solid transparent; }
.res-card.me { border-color: var(--accent); background: var(--card); }
.res-card.gone .res-fig { filter: grayscale(1) opacity(.45); }
/* ник не шире карточки и до двух строк, как на скамье: значок течёт за последним словом,
   многоточие только после второй строки (одной строкой «Макс Ка…» резался, а без ограничения вылезал за карточку) */
.res-card b { font-size: 13.5px; line-height: 1.2; overflow-wrap: anywhere; max-width: 100%; min-width: 0;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.res-card b .nk { display: inline; }
.res-card b .nk-t { white-space: normal; overflow: visible; }
.res-card b .nb { display: inline-flex; vertical-align: -2px; margin-left: 3px; top: 0; }
.res-card small { font-size: 11px; color: var(--muted); }
/* фигурки по низу: обычная 70px, трон Главы выше в 1.3145 раза */
.res-fig { height: 92px; display: flex; align-items: flex-end; }
.res-fig img { height: 70px; display: block; }
.res-fig img.throne { height: 92px; }
.res-tags { display: flex; flex-wrap: wrap; justify-content: center; gap: 3px; }
.res-tags .mayor-pill { background: var(--accent); color: var(--accent-text); font-weight: 800; font-size: 10.5px; padding: 0 7px; border-radius: 8px; }
.role-pill { font-size: 10.5px; font-weight: 700; padding: 0 7px; border-radius: 8px; color: #fff; background: #6C7234; }
.role-pill.role-werewolf { background: #C0392B; }
.role-pill.role-seer { background: #7D4CC2; }
/* за большим столом (больше 6) карточки мельче: до 10 игроков в два ряда по 5 */
.result-dialog.many .res-grid { gap: 6px; }
.result-dialog.many .res-card { width: calc((100% - 4 * 6px) / 5); }
.result-dialog.many .res-fig { height: 74px; }
.result-dialog.many .res-fig img { height: 56px; }
.result-dialog.many .res-fig img.throne { height: 74px; }
.result-dialog.many .res-card b { font-size: 12.5px; }
/* кнопки итога: «Ещё раунд» залитая с объёмным низом, «Посмотреть стол» и ожидание светлые */
.res-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.res-btns button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 46px; margin: 0; padding: 0 14px;
                   border-radius: 12px; font-size: 15.5px; font-weight: 700; }
.res-btns button:not(.plain) { box-shadow: 0 3px 0 rgba(0, 0, 0, .22); transition: transform .1s, box-shadow .1s; }
.res-btns button:not(.plain):hover { transform: translateY(-1px); box-shadow: 0 4px 0 rgba(0, 0, 0, .22); }
.res-btns button:not(.plain):active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(0, 0, 0, .22); }
.res-btns button.plain { background: var(--soft); border-color: transparent; color: var(--accent); }
.res-btns button.plain:hover:not(:disabled) { border-color: var(--accent); }
.res-btns button.plain:disabled { opacity: 1; color: var(--muted); }
/* на телефоне карточек итога три в ряд во всю ширину, как в голосовании, а не две узкие посередине */
@media (max-width: 520px) { .res-card { width: calc((100% - 2 * 8px) / 3); } }
@media (max-width: 420px) { .res-btns { grid-template-columns: 1fr; } .result-dialog.many .res-card { width: calc((100% - 2 * 6px) / 3); } }
/* три в ряд: промежуток тот же 8px, что в расчёте ширины (с 10px третья карточка не влезала и уходила вниз) */
@media (max-width: 520px) { .vote-grid, .vote-dialog.many .vote-grid { gap: 8px; }
  .vote-grid .vote-card, .vote-dialog.many .vote-grid .vote-card { width: calc((100% - 2 * 8px) / 3); } }
/* на сенсорном экране карточка не подпрыгивает от касания */
@media (hover: none) { .vote-card:hover:not(:disabled) { transform: none; box-shadow: none; } }
/* окно подтверждения и сообщения вместо стандартных окон браузера (common.js, ask и tell),
   по концепту окна паузы в docs/design/word-dialog.html: значок в кружке, вопрос, пояснение, две кнопки */
dialog.ask-dialog { width: min(420px, calc(100vw - 32px)); }
.ask-dialog form { display: grid; gap: 10px; padding: 24px 22px 20px; text-align: center; }
.ask-icon { width: 60px; height: 60px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 2px; background: var(--soft); color: var(--accent); }
.ask-icon.danger { background: #FBE7E4; color: #C0392B; }
:root[data-theme="dusk"] .ask-icon.danger { background: #3A2224; color: #F2B8B5; }
.ask-icon svg { width: 28px; height: 28px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ask-dialog h2 { margin: 0; font-size: 20px; line-height: 1.25; overflow-wrap: anywhere; }
.ask-text { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.45; white-space: pre-line; } /* перевод строки в тексте — новая строка */
.ask-facts { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 6px; text-align: left; }
.ask-facts li { padding: 8px 12px; border-radius: 10px; background: var(--soft); font-size: 14px; }
.ask-warn { margin: 0; padding: 9px 12px; border-radius: 10px; font-size: 14px; font-weight: 600; text-align: left; line-height: 1.4;
  color: var(--error); background: color-mix(in srgb, var(--error) 10%, transparent); border: 1px solid color-mix(in srgb, var(--error) 30%, transparent); }
.ask-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 8px; }
.ask-btns.one { grid-template-columns: 1fr; }
/* окно «зачем аккаунт» перед регистрацией (docs/design/create-gate.html, A): синяя шапка с оливкой, выгоды плашками */
dialog.gate-dialog { width: min(420px, calc(100vw - 32px)); border: 0; border-radius: 20px; overflow: hidden; box-shadow: 0 20px 50px rgba(0, 0, 0, .35); }
.gate-x { position: absolute; top: 12px; right: 12px; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 50%; display: grid; place-items: center;
  background: rgba(255, 255, 255, .18); color: #fff; font-size: 14px; cursor: pointer; }
.gate-head { padding: 26px 22px 18px; text-align: center; background: linear-gradient(140deg, #1E3A5F, #2F6FB2); color: #fff; }
.gate-head img { height: 86px; display: block; margin: 0 auto 8px; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .3)); }
.gate-head h2 { margin: 0; font-size: 21px; line-height: 1.25; color: #fff; }
.gate-head p { margin: 6px 0 0; font-size: 14px; opacity: .85; }
.gate-body { padding: 18px 22px; }
.gate-perks { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 8px; }
.gate-perks li { display: flex; align-items: center; justify-content: flex-start; gap: 12px; padding: 10px 12px; border-radius: 12px; background: var(--soft); font-size: 14.5px; font-weight: 600; text-align: left; }
.gate-perks i { font-style: normal; font-size: 20px; width: 26px; text-align: center; flex: none; }
.gate-go { display: block; width: 100%; height: 50px; margin: 0; border: 0; border-radius: 14px; font-size: 16px; font-weight: 800;
  background: #F2C14E; color: #2A1E00; box-shadow: 0 3px 0 #C99A2E; cursor: pointer; }
.gate-go:hover { background: #F2C14E; filter: brightness(1.04); }
.gate-login { display: block; width: 100%; margin: 8px 0 0; padding: 10px; border: 0; background: none; color: var(--muted); font-size: 14px; font-weight: 600; cursor: pointer; }
.gate-login:hover { background: none; color: var(--text); }
.gate-alt { margin: 14px 0 0; padding-top: 12px; border-top: 1px dashed var(--line); font-size: 13px; color: var(--muted); text-align: center; line-height: 1.45; }
.ask-btns button { height: 44px; margin: 0 !important; padding: 0 14px; border-radius: 12px; font-size: 15px; font-weight: 700; }
.ask-btns button.plain { background: var(--soft); border-color: transparent; color: var(--accent); }
.ask-btns button.plain:hover { border-color: var(--accent); }
.ask-btns button.danger-fill { background: #C0392B; color: #fff; }
.ask-btns button.danger-fill:hover { filter: brightness(1.08); }
/* окно «Кто будет Главой?», вариант B из docs/design/mayor-choice.html */
dialog.mayor-dialog { width: min(580px, calc(100vw - 32px)); padding: 0; overflow: hidden; }
.md-band { display: flex; align-items: center; gap: 14px; padding: 16px 20px; background: #FFF6DA; }
:root[data-theme="dusk"] .md-band { background: #3A3320; }
@media (prefers-color-scheme: dark) { :root:not([data-theme]) .md-band { background: #3A3320; } }
.md-band img { height: 84px; flex: none; }
.md-band > div { flex: 1; min-width: 0; }
.md-band b { display: block; font-size: 21px; }
.md-band span { font-size: 13.5px; color: var(--muted); }
.md-band .timer { background: var(--card); }
.md-band button { margin: 0; align-self: flex-start; }
.md-body { padding: 16px 20px 18px; display: grid; gap: 14px; }
.md-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.md-cards.two { grid-template-columns: repeat(2, 1fr); } /* окно «Глава не вернулся» */
.md-cards button { margin: 0; display: grid; justify-items: center; align-content: start; gap: 4px; padding: 12px 8px; border-radius: 14px;
  background: var(--soft); color: var(--text); border: 2px solid transparent; font-weight: 400; text-align: center; }
.md-cards button:hover { border-color: var(--accent); }
.md-cards .em { font-size: 28px; line-height: 1; }
.md-cards b { font-size: 15px; }
.md-cards span:last-child { font-size: 12px; color: var(--muted); }
.md-cards button.on { border-color: #2E8B57; background: #E5F4EC; }
:root[data-theme="dusk"] .md-cards button.on { background: #1E3A2C; }
@media (prefers-color-scheme: dark) { :root:not([data-theme]) .md-cards button.on { background: #1E3A2C; } }
.md-queue { display: grid; gap: 6px; }
.md-queue small { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.md-row { display: flex; flex-wrap: wrap; gap: 6px; }
.md-pl { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 4px; border-radius: 999px; background: var(--soft); font-size: 13px; }
.md-pl img { height: 26px; }
.md-wait { font-style: normal; font-size: 11px; font-weight: 700; padding: 0 7px; border-radius: 8px; background: #E0B000; color: #2A2200; }
.md-foot { margin: 0; font-size: 12.5px; color: var(--muted); text-align: center; }
@media (max-width: 520px) {
  .md-cards { grid-template-columns: 1fr; }
  .md-cards button { grid-template-columns: 36px 1fr; justify-items: start; text-align: left; }
  .md-cards .em { grid-row: span 2; align-self: center; }
  .md-band img { height: 60px; }
}
/* за столом во время выбора Главы: ответы у мест и пустой трон во главе */
.g-seat .tg .wish-want { background: #2E8B57; color: #fff; font-weight: 700; }
.g-seat .tg .wish-no { background: #9AA5B1; color: #fff; }
.g-seat .tg .wish-wait { background: #E0B000; color: #2A2200; font-weight: 700; }
.g-seat.empty-throne .fig { opacity: .5; }
.g-seat.empty-throne .nm { color: var(--muted); font-size: 12px; }
/* счёт комнаты в лобби полосой (docs/design/lobby-panel.html, C) */
.score-bar { display: grid; gap: 5px; }
.score-bar small { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.score-bar .track { display: flex; height: 22px; border-radius: 11px; overflow: hidden; font-size: 12px; font-weight: 800; color: #fff; }
.score-bar .track span { display: grid; place-items: center; min-width: 26px; font-variant-numeric: tabular-nums; }
.score-bar .track .v, .score-bar .legend .v { background: #2E8B57; }
.score-bar .track .w { background: #C0392B; }
.score-bar .legend { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 12px; font-weight: 700; }
.score-bar .legend small { font-size: 11px; font-weight: 400; letter-spacing: .04em; text-transform: none; }
.score-bar .legend .v { background: none; color: #2E8B57; }
.score-bar .legend .w { color: #C0392B; }
.start-btn { height: 46px; margin: 0; border-radius: 12px; font-size: 16px; font-weight: 700; display: inline-flex; align-items: center;
  justify-content: center; gap: 8px; box-shadow: 0 3px 0 rgba(0, 0, 0, .2); }
.start-btn:disabled { box-shadow: none; }
.start-btn .ic { fill: currentColor; }
.play .muted.center { text-align: center; margin: 0; }

/* окно «Как играть»: роли фигурками и четыре шага раунда */
dialog.rules-dialog { width: min(620px, calc(100vw - 32px)); }
.rules-dialog form { display: grid; gap: 14px; }
.rules-dialog .modal-head h2 { font-size: 21px; }
.rl-lead { margin: 0; font-size: 15px; line-height: 1.45; }
.rl-roles { display: grid; gap: 6px; }
.rl-role { display: flex; align-items: center; gap: 10px; padding: 5px 12px 5px 8px; border-radius: 12px; background: var(--soft); }
.rl-role img { height: 42px; flex: none; }
.rl-role b { font-size: 14.5px; }
.rl-role span { font-size: 13.5px; color: var(--muted); line-height: 1.35; }
.rl-role.role-seer b { color: #7D4CC2; }
.rl-role.role-werewolf b { color: #C0392B; }
.rl-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.rl-steps li { display: grid; grid-template-columns: 28px 1fr; gap: 10px; align-items: start; }
.rl-n { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--accent-text); font-weight: 800; font-size: 14px; }
.rl-steps b { font-size: 15px; }
.rl-steps p { margin: 2px 0 0; font-size: 14px; color: var(--muted); line-height: 1.5; }
.rl-steps .tok { font-size: 12px; }

/* --- профиль игрока (docs/design/profile.html, вариант C): слева «паспорт» и меню, справа раздел --- */
.pf { max-width: 1180px; margin: 24px auto 48px; padding: 0 16px; display: grid; grid-template-columns: 270px 1fr; gap: 16px; align-items: start; }
.pf > * { min-width: 0; }
.pf .card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 18px; margin: 0; }
.pf-nav { position: sticky; top: 16px; display: grid; gap: 6px; }
.pf-pass { text-align: center; display: grid; justify-items: center; gap: 2px; padding-bottom: 12px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.pf-pass img { height: 120px; }
.pf-pass h1 { margin: 4px 0 0; font-size: 22px; overflow-wrap: anywhere; }
.pf-pass .muted { font-size: 13px; }
.pf-nav nav { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; }
/* пункты одной высоты: со значком игры и без */
.pf-nav nav a, .pf-nav nav span.soon { display: flex; align-items: center; gap: 10px; min-height: 44px; box-sizing: border-box; padding: 6px 12px; border-radius: 10px;
  font-size: 14.5px; color: var(--text); text-decoration: none; }
/* длинное название не растягивает меню: обрезается многоточием, число и «скоро» остаются внутри */
.pf-nav nav a > span, .pf-nav nav span.soon > span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-nav nav a:hover { background: var(--soft); }
.pf-nav nav a.on { background: var(--soft); font-weight: 700; color: var(--accent); }
.pf-nav nav img { height: 28px; width: 22px; object-fit: contain; flex: none; }
.pf-nav nav i.pf-olive { position: relative; width: 24px; height: 24px; margin: 0 -1px; flex: none; border-radius: 50%; overflow: hidden; }
.pf-nav nav .pf-olive img { position: absolute; left: 50%; top: 2px; width: auto; height: 46px; transform: translateX(-50%); object-fit: initial; }
.pf-nav nav i { width: 22px; flex: none; text-align: center; font-style: normal; font-size: 16px; color: var(--muted); }
.pf-nav nav a.on i { color: var(--accent); }
.pf-nav nav small { flex: none; font-size: 12px; color: var(--muted); font-weight: 400; }
.pf-nav nav .soon { opacity: .55; cursor: default; }
.pf-main h2 { margin: 0; font-size: 21px; }
.pf-sub { margin: 4px 0 0; font-size: 13.5px; }
.pf-lab { display: block; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 18px 0 8px; }
.pf-lab.first { margin-top: 0; }
.pf-more { display: inline-block; margin-top: 10px; font-size: 14px; color: var(--accent); }
.pf-main > button.plain { margin-top: 10px; }
.c-town { color: #2E8B57; } .c-wolf { color: #C0392B; } .c-seer { color: #7D4CC2; }
/* карточки игр */
/* порядочность в обзоре профиля: число, полоска цвета по порогу, правило строкой */
/* опыт в окне итога (docs/design/xp-result.html, B) */
.res-xp { --gold: #C99A2E; --gold-text: #9A6B00; margin-top: 12px; display: grid; gap: 8px; }
.res-xp-box { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; background: color-mix(in srgb, var(--gold) 10%, transparent); }
.res-xp-medal { width: 46px; height: 46px; flex: none; border-radius: 50%; display: grid; place-items: center; color: #fff; font: 900 20px/1 system-ui, sans-serif;
  background: radial-gradient(circle at 35% 30%, #F6D27A, #C99A2E 60%, #9A6B00); box-shadow: 0 2px 0 #7A5400, inset 0 0 0 3px rgba(255, 255, 255, .35); }
.res-xp-medal.pop { animation: res-xp-pop .7s cubic-bezier(.3, 1.6, .5, 1) 1.3s both; }
@keyframes res-xp-pop { from { transform: scale(.6); } to { transform: scale(1); } }
.res-xp-mid { flex: 1; min-width: 0; }
.res-xp-top { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 6px; font-size: 14px; }
.res-xp-top b { color: var(--gold-text); }
.res-xp-top span, .res-xp-left { color: var(--muted); font-size: 13px; }
.res-xp-left { margin-top: 5px; }
.res-xp-left b { color: var(--gold-text); }
.res-xp-bar { position: relative; height: 10px; border-radius: 5px; background: color-mix(in srgb, var(--gold) 20%, transparent); overflow: hidden; }
.res-xp-bar i { position: absolute; top: 0; bottom: 0; }
.res-xp-bar .old { left: 0; background: var(--gold); }
.res-xp-bar .new { width: 0; background: #F2C14E linear-gradient(90deg, transparent, rgba(255, 255, 255, .55), transparent) no-repeat;
  background-size: 60px 100%; transition: width 1.1s cubic-bezier(.2, .8, .2, 1) .3s; animation: res-xp-shine 1.6s linear infinite; }
@keyframes res-xp-shine { from { background-position: -60px 0; } to { background-position: 260px 0; } }
.res-xp-unlock { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 10px; font-size: 13px;
  background: color-mix(in srgb, var(--gold) 14%, transparent); }
.res-xp-unlock img { height: 30px; flex: none; }
.res-xp-none { margin: 12px 0 0; text-align: center; color: var(--muted); font-size: 13px; }

/* окно «Новый цвет оливки!» поверх итога (docs/design/color-unlock.html, 3): лучи, сияние, конфетти; --tone — новый цвет */
dialog.cu-dialog { width: min(330px, calc(100vw - 32px)); padding: 22px 20px 18px; text-align: center; overflow: hidden;
  border: 1px solid color-mix(in srgb, #E3B341 55%, transparent); box-shadow: 0 24px 60px rgba(0, 0, 0, .4), 0 0 0 4px color-mix(in srgb, #E3B341 14%, transparent);
  animation: cu-rise .55s cubic-bezier(.3, 1.5, .5, 1) both; }
dialog.cu-dialog > * { position: relative; }
.cu-sky { position: absolute !important; inset: 0; pointer-events: none; overflow: hidden; }
.cu-rays { position: absolute; left: 50%; top: 150px; width: 560px; height: 560px; margin: -280px 0 0 -280px; border-radius: 50%; opacity: 0;
  background: repeating-conic-gradient(from 0deg, color-mix(in srgb, #F2C14E 26%, transparent) 0 9deg, transparent 9deg 24deg);
  -webkit-mask: radial-gradient(circle, #000 18%, transparent 62%); mask: radial-gradient(circle, #000 18%, transparent 62%);
  animation: cu-fade .8s ease .5s forwards, cu-spin 24s linear infinite; }
.cu-glow { position: absolute; left: 50%; top: 150px; width: 210px; height: 210px; margin: -105px 0 0 -105px; border-radius: 50%; opacity: 0;
  background: radial-gradient(circle, color-mix(in srgb, var(--tone) 55%, transparent), color-mix(in srgb, #F2C14E 18%, transparent) 45%, transparent 70%);
  animation: cu-fade .6s ease .7s forwards, cu-breathe 2.6s ease-in-out 1.3s infinite; }
.cu-conf { position: absolute; top: -14px; width: 7px; height: 12px; border-radius: 2px; opacity: 0; animation: cu-fall 2.2s cubic-bezier(.3, .4, .6, 1) var(--d) both; }
.cu-level { display: block; font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--gold-text, #9A6B00); }
.cu-title { margin: 4px 0 0; font-size: 23px; font-weight: 900; background: linear-gradient(100deg, var(--text) 35%, #E3B341 50%, var(--text) 65%);
  background-size: 250% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: cu-shimmer 2.4s ease-in-out .9s 2 both; }
.cu-fig { height: 150px; margin: 8px auto 0; width: 150px; }
.cu-fig img { position: absolute; left: 50%; bottom: 0; height: 140px; transform: translateX(-50%); }
.cu-grey { filter: grayscale(1) brightness(1.05); animation: cu-hop .8s cubic-bezier(.3, 1.7, .5, 1) .4s both, cu-out .6s ease 1.15s forwards; }
.cu-new { opacity: 0; animation: cu-hop .8s cubic-bezier(.3, 1.7, .5, 1) .4s both, cu-in .6s ease 1.15s forwards, cu-bob 2.6s ease-in-out 2s infinite; }
.cu-spark { position: absolute; left: 50%; top: 55%; color: #F2C14E; font-size: 16px; opacity: 0; text-shadow: 0 0 8px rgba(242, 193, 78, .8);
  animation: cu-spark 1.1s ease-out 1.2s both; }
.cu-spark.s0 { --dx: -78px; --dy: -52px; } .cu-spark.s1 { --dx: 74px; --dy: -60px; } .cu-spark.s2 { --dx: 86px; --dy: 6px; font-size: 12px; }
.cu-spark.s3 { --dx: -88px; --dy: 10px; font-size: 12px; } .cu-spark.s4 { --dx: -30px; --dy: -86px; font-size: 13px; } .cu-spark.s5 { --dx: 36px; --dy: -84px; }
.cu-name { margin: 6px 0 0; font-size: 15px; }
.cu-name b { display: inline-block; padding: 3px 14px; border-radius: 999px; color: #fff; background: var(--tone); box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .18);
  animation: cu-in .4s ease 1.3s both; }
.cu-more { margin: 6px 0 0; font-size: 13px; color: var(--muted); }
.cu-acts { display: flex; gap: 8px; margin-top: 16px; }
.cu-acts button { flex: 1; margin: 0; }
.cu-dialog .error { text-align: center; }
@keyframes cu-rise { from { opacity: 0; transform: translateY(26px) scale(.86); } }
@keyframes cu-fade { to { opacity: 1; } }
@keyframes cu-spin { to { rotate: 360deg; } }
@keyframes cu-breathe { 0%, 100% { scale: 1; } 50% { scale: 1.08; } }
@keyframes cu-fall { 0% { opacity: 1; transform: translate(0, 0) rotate(0); } 80% { opacity: 1; } 100% { opacity: 0; transform: translate(var(--x), 440px) rotate(var(--r)); } }
@keyframes cu-shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }
@keyframes cu-hop { from { transform: translateX(-50%) translateY(18px) scale(.35); } to { transform: translateX(-50%) translateY(0) scale(1); } }
@keyframes cu-out { to { opacity: 0; } }
@keyframes cu-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes cu-bob { 0%, 100% { translate: 0 0; } 50% { translate: 0 -5px; } }
@keyframes cu-spark { 0% { opacity: 0; transform: translate(-50%, -50%) scale(.3); } 30% { opacity: 1; }
  100% { opacity: 0; transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(1.2) rotate(120deg); } }
@media (prefers-reduced-motion: reduce) {
  dialog.cu-dialog, dialog.cu-dialog * { animation-duration: .01s !important; animation-iteration-count: 1 !important; animation-delay: 0s !important; }
  .cu-conf { display: none; }
}
.res-xp .res-xp-none { margin: 0; }
/* обзор: уровень и порядочность слева, награды сезонов справа; на узком экране друг под другом */
.pf-top { display: grid; grid-template-columns: minmax(0, 520px) minmax(220px, 1fr); gap: 0 24px; align-items: start; }
@media (max-width: 860px) { .pf-top { grid-template-columns: minmax(0, 1fr); } }
.pf-awards { display: grid; gap: 8px; }
.pf-awards.empty { padding: 14px; border-radius: 14px; background: var(--soft); }
.pf-awards.empty p { margin: 0; font-size: 13px; }
.pf-awards.empty p + p { margin-top: 6px; }
.pf-award { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 14px; background: var(--soft);
  box-shadow: inset 4px 0 0 var(--aw, #8A94A6); }
.pf-award.p1 { --aw: #D4A62A; }
.pf-award.p2 { --aw: #A8B2BD; }
.pf-award.p3 { --aw: #C07A3E; }
.pf-award .pf-medal { font-size: 28px; line-height: 1; color: inherit; }
.pf-award b { display: block; font-size: 15px; }
.pf-award span { font-size: 12.5px; color: var(--muted); }
.pf-level { --dc: #C99A2E; display: grid; gap: 8px; padding: 14px; border-radius: 14px; background: var(--soft); max-width: 520px; }
.pf-level p { margin: 0; font-size: 13px; }
/* плашка «сегодня» и «Как получить опыт» (docs/design/profile-level.html, B) */
.pf-today { --sun: #E08A2E; margin-left: auto; display: inline-flex; gap: 5px; align-items: center; padding: 3px 10px; border-radius: 999px;
            font-size: 12.5px; color: var(--muted); background: color-mix(in srgb, var(--sun) 13%, transparent); white-space: nowrap; }
.pf-level .pf-today b { font-size: 12.5px; line-height: inherit; color: var(--sun); }
.pf-today-ring { width: 14px; height: 14px; border-radius: 50%; flex: none;
                 background: conic-gradient(var(--sun) var(--p), color-mix(in srgb, var(--sun) 25%, transparent) 0); }
.pf-how { font-size: 13px; }
.pf-how summary { cursor: pointer; color: var(--muted); }
.pf-how ul { margin: 6px 0 0; padding-left: 18px; display: grid; gap: 3px; }
.pf-how p { margin-top: 6px; }
.pf-how > a { display: inline-block; margin-top: 6px; }
.pf-lvl-colors { display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 8px; margin-top: 8px; }
.pf-lvl-colors > div { display: grid; justify-items: center; gap: 3px; }
.pf-lvl-dot { position: relative; width: 40px; height: 40px; }
.pf-lvl-colors .pf-head { position: absolute; inset: 0; background: var(--card); }
.pf-lvl-colors .pf-head img { height: 64px; top: 3px; }
.pf-lvl-dot i { position: absolute; right: -4px; bottom: -2px; width: 17px; height: 17px; border-radius: 50%; display: grid; place-items: center;
                font: normal 700 10px/1 system-ui, sans-serif; background: var(--card); box-shadow: 0 0 0 1.5px var(--line); }
.pf-lvl-colors .open .pf-lvl-dot i { background: #2E8B57; color: #fff; box-shadow: none; }
.pf-lvl-colors small { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.pf-lvl-colors .locked .pf-head { opacity: .35; filter: grayscale(.7); }
.pf-pills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.pf-pills .pf-dec-pill { margin-top: 0; }
/* рейтинг (docs/design/leaderboard.html): блок на главной (A) и страница /leaders (B) */
.lb-tabs { display: inline-flex; gap: 2px; padding: 3px; margin-bottom: 10px; border-radius: 10px; background: var(--soft); }
.lb-tabs button { border: 0; background: none; padding: 5px 12px; border-radius: 8px; font: inherit; font-size: 13px; color: var(--muted); cursor: pointer; }
.lb-tabs button.on { background: var(--card); color: var(--text); font-weight: 700; box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.lb-list { display: grid; gap: 4px; }
.lb-row { display: grid; grid-template-columns: 28px 30px 1fr auto; gap: 10px; align-items: center; padding: 4px 10px; border-radius: 10px;
  color: inherit; text-decoration: none; background: var(--soft); }
.lb-row:hover { outline: 1px solid var(--line); }
.lb-row.me { font-weight: 700; background: color-mix(in srgb, #C99A2E 18%, transparent); outline: 1px solid color-mix(in srgb, #C99A2E 50%, transparent); }
.lb-row img { height: 30px; justify-self: center; }
.lb-place { text-align: center; font-weight: 800; color: var(--muted); font-variant-numeric: tabular-nums; }
.lb-place.lead { font-size: 18px; }
.lb-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-lvl { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.lb-medal { width: 24px; height: 24px; border-radius: 50%; display: inline-grid; place-items: center; color: #fff; font: 900 11px/1 system-ui, sans-serif;
  background: radial-gradient(circle at 35% 30%, #F6D27A, #C99A2E 60%, #9A6B00); box-shadow: 0 1px 0 #7A5400; }
.lb-mine { margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line); }
.lb-more { display: inline-block; margin-top: 10px; font-size: 14px; }
.lb-empty, .lb-note { margin: 8px 0 0; font-size: 13px; }
.lb-home h2 { margin-bottom: 8px; }
main.lb-page { max-width: 640px; }
.lb-page h1 { margin: 0 0 2px; }
.lb-sub { margin: 0 0 12px; font-size: 14px; }
.lb-podium { display: flex; justify-content: center; align-items: flex-end; gap: 10px; margin: 8px 0 14px; }
.lb-pod { width: 130px; text-align: center; color: inherit; text-decoration: none; display: flex; flex-direction: column; align-items: center; }
.lb-pod img { height: 60px; }
.lb-pod b { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.lb-pod small { color: var(--muted); font-size: 12px; }
.lb-step { align-self: stretch; margin-top: 4px; border-radius: 10px 10px 0 0; color: #fff; font-weight: 900; font-size: 20px; display: grid; place-items: center; }
.lb-pod.p1 .lb-step { height: 70px; background: #C99A2E; }
.lb-pod.p2 .lb-step { height: 52px; background: #9AA5B1; }
.lb-pod.p3 .lb-step { height: 40px; background: #B87333; }
@media (max-width: 480px) { .lb-pod { width: 100px; } .lb-pod img { height: 48px; } }
/* главная на компьютере (docs/design/home-desktop.html, C); на телефоне — лента блоков, как была */
.home-wide { display: none; }
@media (min-width: 1000px) {
  main.home { max-width: 1100px; }
  main.home > :not(.home-wide) { display: none !important; }
  .home-wide { display: block; }
}
.hw-hero { display: grid; grid-template-columns: auto 1fr auto; gap: 20px; align-items: center; padding: 20px 24px; border-radius: 16px;
  background: linear-gradient(120deg, #1E3A5F, #2F6FB2); color: #fff; }
.hw-olive img { height: 84px; display: block; }
.hw-hi h2 { margin: 0 0 4px; font-size: 24px; color: #fff; }
.hw-hi p { margin: 0; font-size: 14px; opacity: .88; }
/* медаль уровня перед приветствием: как в рейтинге, чуть крупнее под заголовок */
.hw-medal { width: 26px; height: 26px; margin-right: 10px; font-size: 12px; vertical-align: 3px; text-decoration: none; }
.hw-acts { display: grid; gap: 8px; width: 360px; }
.hw-acts .hw-big { display: block; width: 100%; box-sizing: border-box; padding: 12px; border: 0; border-radius: 10px; text-align: center; text-decoration: none;
  background: #F2C14E; color: #3A2A00; font-weight: 800; font-size: 16px; cursor: pointer;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hw-acts .hw-big:hover { background: #F6CD65; color: #3A2A00; }
.hw-acts .row { display: flex; gap: 8px; margin: 0; }
.hw-acts input { flex: 1; min-width: 0; margin: 0; background: rgba(255, 255, 255, .96); color: #1B2430; }
.hw-acts .row button { background: rgba(255, 255, 255, .16); color: #fff; border: 1px solid rgba(255, 255, 255, .55); }
.hw-acts .row button:hover { background: rgba(255, 255, 255, .28); }
.hw-acts .error { margin: 0; color: #FFD7D2; }
.hw-acts .error:empty { display: none; }
.hw-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 16px; margin-top: 16px; }
/* низ колонок вровень: лишнюю высоту забирает «Во что играем» слева или «Лучшие игроки» справа */
.hw-grid > div { display: flex; flex-direction: column; }
.hw-grid .hw-games, #hw-side > section { flex: 1; }
.hw-games { display: flex; flex-direction: column; }
.hw-games .lb-more { margin-top: auto; padding-top: 10px; align-self: flex-start; }
.hw-grid section, #hw-side section { margin: 0; }
.hw-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.hw-card { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 10px; border-radius: 12px; background: var(--soft); text-align: center; }
.hw-card img { height: 76px; }
.hw-card b { font-size: 15px; }
.hw-card small { color: var(--muted); font-size: 12.5px; }
/* кнопки прижаты к низу: в одну линию, даже если описание у игр разной длины */
/* плашки популярности тоже у низа, над кнопкой: в одну линию у всех карточек */
/* карусель игр (docs/design/game-carousel.html, A): цвет фона и плашки — под тип слайда, слайд тает и сменяется */
.new-game { --tc: #C99A2E; position: relative; touch-action: pan-y; padding: 16px; border-radius: 12px; transition: background .9s ease, border-color .9s ease;
  background: linear-gradient(90deg, color-mix(in srgb, var(--tc) 24%, var(--card)), var(--card)); border: 1px solid color-mix(in srgb, var(--tc) 50%, transparent); }
.new-game.k-hit { --tc: #D2582A; } .new-game.k-try { --tc: #2F6FB2; } .new-game.k-live { --tc: #2E8B57; }
.new-game[hidden] { display: none; }
/* смена: старый слайд тает и уходит вверх, новый выплывает снизу (владелец: «переход плавнее») */
.ng-slide { display: flex; align-items: center; gap: 14px; min-height: 54px; transition: opacity .45s ease, transform .45s ease; }
.ng-slide.out { opacity: 0; transform: translateY(-8px); }
.ng-slide.in { opacity: 0; transform: translateY(8px); transition: none; }
.ng-slide img { height: 50px; flex: none; }
.ng-text { flex: 1; min-width: 0; font-size: 13.5px; color: var(--muted); }
.ng-text b { display: block; font-size: 16px; color: var(--text); margin-bottom: 2px; }
/* высота полосы не меняется от слайда к слайду: на компьютере текст в одну строку, на телефоне — ровно две */
.ng-text > span { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
@media (max-width: 999px) {
  .ng-text > span { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; height: 2.9em; line-height: 1.45; }
  /* плашка своей строкой, название под ней в одну строку: длинная «Новинка · Хит месяца · 86 партий» иначе
     переносила название, слайд вырастал и сдвигал страницу (владелец, 2 ноября 2026) */
  .ng-text b .ng-tag { display: table; margin: 0 0 3px; }
  .ng-text b { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
}
.ng-tag { display: inline-block; margin-right: 8px; padding: 1px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 800; background: var(--tc); color: #fff; vertical-align: 2px; }
.ng-slide > button, .ng-slide > a.button { flex: none; padding: 8px 18px; }
/* точки в нижнем отступе: содержимое и кнопка — ровно по центру плашки */
.ng-dots { position: absolute; left: 0; right: 0; bottom: 5px; display: flex; justify-content: center; gap: 6px; }
.ng-dots button { width: 7px; height: 7px; padding: 0; border: 0; border-radius: 4px; background: var(--line); cursor: pointer; transition: width .3s; }
.ng-dots button.on { width: 18px; background: var(--tc); }
#hw-new .new-game { margin-top: 14px; }
@media (max-width: 999px) { .new-game { padding-bottom: 20px; } .ng-slide { flex-wrap: wrap; } .ng-slide > button, .ng-slide > a.button { width: 100%; text-align: center; } }
.hw-card { position: relative; }
.hw-card.new { outline: 2px solid #F2C14E; }
.hw-newtag { position: absolute; top: 8px; right: 8px; padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 800; background: #F2C14E; color: #3A2A00; }
.hw-hots { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; margin: auto 0 8px; }
.hw-card .hw-hots + button { margin-top: 0; }
.hw-hot { white-space: nowrap; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; color: #B4521F;
  background: color-mix(in srgb, #E8742F 14%, transparent); }
.hw-hot.live { color: #237047; background: color-mix(in srgb, #2E8B57 14%, transparent); }
.hw-hot.live::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 5px; border-radius: 50%; background: #2E8B57; vertical-align: 1px; }
:root[data-theme="dusk"] .hw-hot.live { color: #7FD6A4; }
@media (prefers-color-scheme: dark) { :root:not([data-theme]) .hw-hot.live { color: #7FD6A4; } }
:root[data-theme="dusk"] .hw-hot { color: #F29A5C; }
@media (prefers-color-scheme: dark) { :root:not([data-theme]) .hw-hot { color: #F29A5C; } }
.hw-card button { margin-top: auto; padding: 5px 12px; font-size: 13px; }
.hw-card small { margin-bottom: 8px; }
#hw-bottom section { margin: 16px 0 0; }
/* «Мы в Telegram» на компьютере — узкой полосой */
#hw-bottom .tg-card { display: grid; grid-template-columns: auto 1fr auto; gap: 4px 12px; align-items: center; padding: 12px 18px; }
#hw-bottom .tg-card h2 { margin: 0; font-size: 16px; }
#hw-bottom .tg-card .muted { margin: 0; }
#hw-bottom .tg-card .tg-btn { width: auto; padding: 8px 18px; }
.pf-res-col { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; flex: none; }
.pf-xp { font-size: 11px; font-weight: 700; color: #9A6B00; white-space: nowrap; }
:root[data-theme="dusk"] .pf-xp { color: #E3B341; }
@media (prefers-color-scheme: dark) { :root:not([data-theme]) .pf-xp { color: #E3B341; } }
.pf-lvl-pill { display: inline-flex; gap: 5px; align-items: baseline; padding: 2px 10px; border-radius: 999px; font-size: 13px;
  color: inherit; text-decoration: none; background: color-mix(in srgb, #C99A2E 16%, transparent); }
.pf-lvl-pill b { color: #9A6B00; font-variant-numeric: tabular-nums; }
.pf-vip.mini.lvl { background: #C99A2E; color: #fff; }
/* золото опыта на тёмной теме светлее */
:root[data-theme="dusk"] .res-xp { --gold-text: #E3B341; } :root[data-theme="dusk"] .pf-lvl-pill b { color: #E3B341; }
@media (prefers-color-scheme: dark) { :root:not([data-theme]) .res-xp { --gold-text: #E3B341; } :root:not([data-theme]) .pf-lvl-pill b { color: #E3B341; } }
.pf-decency { --dc: #2E8B57; display: grid; gap: 8px; padding: 14px; border-radius: 14px; background: var(--soft); max-width: 520px; }
.pf-decency.mid { --dc: #C98A12; }
.pf-decency.low { --dc: #C0392B; }
.pf-dec-top { display: flex; align-items: baseline; gap: 6px; }
.pf-dec-top b { font-size: 28px; line-height: 1; color: var(--dc); font-variant-numeric: tabular-nums; }
.pf-dec-warn { margin-left: auto; font-size: 12.5px; font-weight: 700; color: var(--dc); }
.pf-bar { height: 8px; border-radius: 4px; background: color-mix(in srgb, var(--dc) 18%, transparent); overflow: hidden; }
.pf-bar i { display: block; height: 100%; border-radius: 4px; background: var(--dc); }
.pf-decency p { margin: 0; font-size: 13px; }
/* она же плашкой в сводке под именем */
.pf-dec-pill { --dc: #2E8B57; margin-top: 4px; display: inline-flex; gap: 5px; align-items: baseline; padding: 2px 10px; border-radius: 999px;
               font-size: 12.5px; color: var(--muted); text-decoration: none; background: color-mix(in srgb, var(--dc) 13%, transparent); }
.pf-dec-pill b { color: var(--dc); font-variant-numeric: tabular-nums; }
.pf-dec-pill.mid { --dc: #C98A12; }
.pf-dec-pill.low { --dc: #C0392B; }
.pf-games { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.pf-game { display: grid; gap: 8px; align-content: start; padding: 14px; border-radius: 14px; background: var(--soft); border: 2px solid transparent; color: var(--text); text-decoration: none; }
a.pf-game:hover { border-color: var(--accent); }
.pf-gh { display: flex; align-items: center; gap: 10px; }
.pf-gh img { height: 46px; }
.pf-gh b { font-size: 16px; }
.pf-gh span { display: block; font-size: 12px; color: var(--muted); }
.pf-nums { display: flex; gap: 18px; font-size: 12.5px; color: var(--muted); }
.pf-nums b { display: block; font-size: 20px; color: var(--text); }
/* история */
.pf-hist { display: grid; gap: 6px; }
.pf-hc { display: grid; grid-template-columns: 40px 1fr auto; gap: 12px; align-items: center; padding: 7px 12px; border-radius: 12px; background: var(--soft); }
.pf-hc img { height: 40px; justify-self: center; }
.pf-hc b { font-size: 14px; }
.pf-hc div > span { display: block; font-size: 12.5px; color: var(--muted); }
.pf-gname { display: inline-block; font-size: 11px; font-weight: 700; padding: 0 7px; border-radius: 8px; background: var(--card); color: var(--muted); margin-right: 6px; vertical-align: 1px; }
.pf-res { font-size: 12px; font-weight: 700; padding: 1px 9px; border-radius: 10px; color: #fff; white-space: nowrap; }
.pf-res.won { background: #2E8B57; } .pf-res.lost { background: #9AA5B1; } .pf-res.aborted { background: var(--card); color: var(--muted); }
/* статистика «Тайного слова» */
.pf-roles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 16px; }
.pf-rc { display: grid; justify-items: center; gap: 4px; padding: 12px; border-radius: 14px; background: var(--soft); text-align: center; }
.pf-rc img { height: 80px; }
.pf-rc b { font-size: 15px; }
.pf-rc span { font-size: 12.5px; color: var(--muted); }
.pf-ring { --p: 0; width: 66px; height: 66px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--c) calc(var(--p) * 1%), var(--line) 0); }
.pf-ring b { width: 52px; height: 52px; border-radius: 50%; background: var(--card); display: grid; place-items: center; font-size: 15px; }
.pf-facts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.pf-fact { background: var(--soft); border-radius: 999px; padding: 6px 14px; font-size: 13.5px; }
.pf-fact b { font-size: 14.5px; }
/* персонаж */
.pf-persona { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; margin-top: 14px; }
.pf-stage { display: flex; align-items: flex-end; justify-content: center; gap: 26px; padding: 18px 10px 12px; border-radius: 14px; background: var(--soft); }
.pf-stage figure { margin: 0; text-align: center; font-size: 12px; color: var(--muted); }
.pf-stage img { display: block; margin: 0 auto 6px; }
.pf-big-seat { height: 150px; }
.pf-big-throne { height: 197px; }
.pf-where { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.pf-where > div { display: grid; justify-items: center; align-content: end; gap: 4px; padding: 8px; border-radius: 12px; background: var(--soft); text-align: center; font-size: 12px; color: var(--muted); }
.pf-where > div > img { height: 46px; }
.pf-where .avatar img { position: absolute; left: 50%; top: 4px; height: 104px; transform: translateX(-50%); }
.pf-where .pf-guest { filter: grayscale(1) opacity(.6); }
/* выбор мелкими кнопками (persona-compact.html, вариант B): кружки с головой фигурки, квадраты значков и цветов ника */
.pf-dots { display: grid; grid-template-columns: repeat(8, 40px); gap: 8px; }
.pf-dots.five { grid-template-columns: repeat(5, 48px); gap: 10px; }
.pf-dots button { position: relative; margin: 0; padding: 0; width: 40px; height: 40px; min-width: 0; display: grid; place-items: center;
  border-radius: 12px; border: 2px solid transparent; background: var(--soft); color: var(--muted); }
.pf-dots button:hover { border-color: var(--line); }
.pf-dots button.on { border-color: var(--accent); }
.pf-dots button.round { width: 48px; height: 48px; border-radius: 50%; }
.pf-head { position: absolute; inset: 0; border-radius: 50%; overflow: hidden; }
.pf-head img { position: absolute; left: 50%; top: 4px; height: 86px; transform: translateX(-50%); }
.pf-dots .nb svg, .pf-dots .nb img { width: 22px; height: 22px; }
.pf-dots .nb-pill { font-size: 11px; line-height: 17px; padding: 0 5px; }
.pf-aa { font-size: 17px; font-weight: 800; color: var(--text); }
.pf-lab b { margin-left: 6px; text-transform: none; letter-spacing: 0; font-size: 13px; color: var(--text); font-weight: 600; }
/* метка VIP: у ника в «паспорте», на платных цветах и в пояснении */
.pf-vip { display: inline-block; margin-left: 8px; padding: 1px 7px; border-radius: 6px; vertical-align: 3px; font-size: 11px; font-weight: 800;
  letter-spacing: .05em; font-style: normal; color: #3A2A00; background: linear-gradient(135deg, #F7D774, #D9A82E); }
.pf-vip.mini { position: absolute; top: -6px; right: -6px; margin: 0; padding: 0 3px; font-size: 8px; line-height: 13px; vertical-align: 0; z-index: 1; }
.pf-vip-note { display: flex; align-items: center; gap: 8px; margin: 12px 0 8px; font-size: 13px; color: var(--muted); }
.pf-vip-note[hidden] { display: none; }
.pf-vip-note .pf-vip { margin: 0; }
/* вещь в руках в кнопке выбора (docs/design/held-items.html) */
.pf-dots .pf-item { max-width: 30px; max-height: 26px; object-fit: contain; }
.pf-persona .pf-sub { margin: 8px 0 12px; }
.pf-saved { margin: 8px 0 0; font-size: 13px; }
/* аккаунт */
.pf-account { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 14px; align-items: start; }
.pf-form { display: grid; gap: 6px; padding: 14px; border-radius: 14px; background: var(--soft); }
.pf-form h3 { margin: 0 0 4px; font-size: 16px; }
.pf-form label { font-size: 13px; color: var(--muted); margin: 0; }
.pf-form input { background: var(--card); }
.pf-form button { justify-self: start; margin-top: 6px; }
.pf-form .error, .pf-form .pf-saved { margin: 0; }
.pf-sessions { display: grid; gap: 6px; }
.pf-session { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; box-sizing: border-box; padding: 10px 12px 10px 16px;
  border-radius: 12px; background: var(--soft); }
.pf-session b { font-size: 14.5px; line-height: 1.3; }
.pf-session div > span { display: block; font-size: 12.5px; color: var(--muted); }
.pf-session button { margin: 0; height: 28px; box-sizing: border-box; display: inline-flex; align-items: center; }
/* «этот браузер» — метка, а не кнопка: залитая цветом темы, той же высоты, что «Завершить» у соседних строк */
.pf-this { display: inline-flex; align-items: center; gap: 5px; box-sizing: border-box; height: 28px; padding: 0 12px; border-radius: 999px;
  background: var(--accent); color: var(--accent-text); font-size: 12.5px; font-weight: 700; line-height: 1; white-space: nowrap; flex: none; }
@media (max-width: 860px) {
  .pf { grid-template-columns: 1fr; }
  .pf-nav { position: static; }
  .pf-pass { grid-template-columns: auto 1fr; text-align: left; justify-items: start; column-gap: 12px; }
  .pf-pass img { height: 70px; grid-row: span 3; }
  .pf-pass .pf-pills { grid-column: 2; }
  .pf-nav nav { display: flex; overflow-x: auto; gap: 4px; }
  .pf-nav nav a, .pf-nav nav span.soon { white-space: nowrap; flex: none; }
  .pf-nav nav a > span, .pf-nav nav span.soon > span { flex: none; overflow: visible; }
  .pf-roles { grid-template-columns: 1fr 1fr; }
  .pf-persona, .pf-account { grid-template-columns: 1fr; }
  .pf-persona > div { min-width: 0; }
  .pf-hc { grid-template-columns: 34px 1fr; }
  .pf-hc .pf-res-col { grid-column: 2; justify-self: start; flex-direction: row; align-items: center; gap: 8px; }
}

/* --- стиль ника у VIP (docs/design/nick-style.html): цвет текста и значок после ника --- */
.nk { display: inline-flex; align-items: center; gap: 3px; max-width: 100%; min-width: 0; vertical-align: bottom; }
.nk-t { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* значок по середине заглавных букв ника, а не строки: у Segoe UI они на 0,064 размера шрифта ниже середины строки.
   Сдвиг в em от шрифта ника, поэтому плашка «VIP» лежит внутри .nb, а не на нём (у неё свой мелкий шрифт) */
.nb { display: inline-flex; flex: none; align-items: center; position: relative; top: .064em; }
.pf-dots .nb { top: 0; } /* в кнопке выбора значок один, по центру кнопки */
.nb svg, .nb img { width: 15px; height: 15px; display: block; }
.nb-pill { font-size: 9.5px; font-weight: 800; letter-spacing: .04em; padding: 0 4px; border-radius: 5px; line-height: 14px;
           color: #3A2A00; background: linear-gradient(135deg, #F7D774, #D9A82E); }
.nk-gold { background: linear-gradient(180deg, #D9A21B, #A8750A); -webkit-background-clip: text; background-clip: text; color: transparent; }
.nk-silver { background: linear-gradient(180deg, #8C98A6, #5B6673); -webkit-background-clip: text; background-clip: text; color: transparent; }
.nk-violet { color: #7D4CC2; } .nk-teal { color: #13827A; } .nk-rose { color: #C2416E; } .nk-fire { color: #D2551E; } .nk-sky { color: #2F74C0; }
/* тёмные темы: светлее, иначе ник тонет в фоне */
:root[data-theme="dusk"] .nk-gold { background-image: linear-gradient(180deg, #FFE08A, #E3B341); }
:root[data-theme="dusk"] .nk-silver { background-image: linear-gradient(180deg, #E6ECF2, #A9B6C4); }
:root[data-theme="dusk"] .nk-violet { color: #B794F4; } :root[data-theme="dusk"] .nk-teal { color: #4FD1C5; }
:root[data-theme="dusk"] .nk-rose { color: #F687B3; } :root[data-theme="dusk"] .nk-fire { color: #F6AD55; } :root[data-theme="dusk"] .nk-sky { color: #63B3ED; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .nk-gold { background-image: linear-gradient(180deg, #FFE08A, #E3B341); }
  :root:not([data-theme]) .nk-silver { background-image: linear-gradient(180deg, #E6ECF2, #A9B6C4); }
  :root:not([data-theme]) .nk-violet { color: #B794F4; } :root:not([data-theme]) .nk-teal { color: #4FD1C5; }
  :root:not([data-theme]) .nk-rose { color: #F687B3; } :root:not([data-theme]) .nk-fire { color: #F6AD55; } :root:not([data-theme]) .nk-sky { color: #63B3ED; }
}
/* в шапке фон всегда тёмный */
.top .nk-gold { background-image: linear-gradient(180deg, #FFE08A, #E3B341); }
.top .nk-silver { background-image: linear-gradient(180deg, #E6ECF2, #A9B6C4); }
.top .nk-violet { color: #C9B0FA; } .top .nk-teal { color: #6FE0D5; } .top .nk-rose { color: #F9A8C9; } .top .nk-fire { color: #F8BE73; } .top .nk-sky { color: #8CC8F2; }

/* --- место ведущего в лобби: первое на скамье, «помост» (docs/design/host-seat.html, A) --- */
.seat.host { border-radius: 14px; background: linear-gradient(180deg, transparent 0 52%, #F6E7B0 52% 100%); }
:root[data-theme="dusk"] .seat.host { background: linear-gradient(180deg, transparent 0 52%, #3A3320 52% 100%); }
@media (prefers-color-scheme: dark) { :root:not([data-theme]) .seat.host { background: linear-gradient(180deg, transparent 0 52%, #3A3320 52% 100%); } }
.seat .pic .host-tag { position: absolute; left: 50%; top: -14px; transform: translateX(-50%); z-index: 2; white-space: nowrap; box-shadow: 0 1px 2px rgba(0, 0, 0, .2); }
.host-tag { display: inline-flex; align-items: center; box-sizing: border-box; height: 18px; font-size: 10.5px; font-weight: 700; padding: 0 8px 1px; border-radius: 9px; line-height: 1; background: #E3B341; color: #3A2A00; }
/* значок VIP на скамье строкой под ником, рядом с «в сети» (вариант 1): ник во всю ширину */
.seat .sub { display: flex; justify-content: center; align-items: center; gap: 4px; flex-wrap: wrap; }
/* значок в строке «вы · в сети»: под мелкий текст подписи — меньше и без сдвига к заглавным ника */
.seat .sub .nb { top: 0; }
.seat .sub .nb svg, .seat .sub .nb img { width: 13px; height: 13px; }

/* превью ника в «Персонаже»: на скамье и в чате */
/* «без значка»: пустое место пунктиром с мягким прочерком посередине */
.pf-none { position: relative; width: 22px; height: 22px; box-sizing: border-box; border: 1.5px dashed var(--muted); border-radius: 7px; opacity: .7; }
.pf-none::after { content: ""; position: absolute; left: 5px; right: 5px; top: 50%; height: 2.5px; margin-top: -1.25px; border-radius: 2px; background: var(--muted); }
.pf-bench-name { display: grid; justify-items: center; gap: 2px; font-size: 13px; color: var(--text); max-width: 100%; }
.pf-bench-sub { display: flex; align-items: center; gap: 4px; font-size: 11px; color: var(--muted); }
.pf-chat { margin-top: 10px; padding: 10px 12px; border-radius: 12px; background: var(--soft); font-size: 14px; }
.pf-chat small { display: block; font-size: 11px; color: var(--muted); margin-bottom: 4px; }
.pf-pass h1 { display: flex; align-items: center; justify-content: center; gap: 5px; max-width: 100%; }
.pf-pass h1 .nb svg, .pf-pass h1 .nb img { width: 20px; height: 20px; }
.pf-pass h1 .nb-pill { font-size: 11px; line-height: 17px; padding: 0 5px; }
.pf-pass h1 .verified { width: 18px; height: 18px; }
@media (max-width: 860px) { .pf-pass h1 { justify-content: flex-start; } }
/* узкий телефон: восемь кнопок в строку сжимаются, а не вылезают */
@media (max-width: 420px) { .pf-dots { grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 5px; } .pf-dots button { width: auto; height: auto; aspect-ratio: 1; } }

/* Плашки (роль, Глава, «ведущий», VIP, «ждёт», «этот браузер»…): текст ровно по центру букв.
   Обычно текст встаёт по центру строки шрифта, а у Segoe UI место над буквами и под ними разное,
   и буквы сидели на 0,5–1,5 px ниже середины. text-box обрезает строку по верху заглавных (cap)
   или строчных (ex) букв и по линии, на которой они стоят, тогда равные отступы и правда равные.
   --ph — прежняя высота плашки; без поддержки text-box (старые браузеры) всё как было. */
@supports (text-box: trim-both cap alphabetic) {
  .seat-tag, .g-seat .tg span, .mayor-pill, .role-pill, .nb-pill, .pf-vip, .pf-gname {
    display: inline-block; box-sizing: border-box; height: auto; line-height: 1;
    text-box: trim-both cap alphabetic; }
  .host-tag, .md-wait, .pf-res, .tag, .pf-this {
    display: inline-block; box-sizing: border-box; height: auto; line-height: 1;
    text-box: trim-both ex alphabetic; }
  /* отступы теми же селекторами, что у самих плашек, иначе их прежние padding перебивают */
  .seat-tag, .g-seat .tg span, .res-tags .mayor-pill, .g-role .mayor-pill, .role-sheet .mayor-pill, .vote-tags .mayor-pill, .role-pill,
  .nb-pill, .pf-dots .nb-pill, .pf-opts .nb-pill, .pf-pass h1 .nb-pill, .pf-vip, .pf-vip.mini, .pf-gname {
    padding-top: calc((var(--ph) - 1cap) / 2); padding-bottom: calc((var(--ph) - 1cap) / 2); }
  .host-tag, .seat .pic .host-tag, .md-wait, .pf-res, .tag, .pf-this {
    padding-top: calc((var(--ph) - 1ex) / 2); padding-bottom: calc((var(--ph) - 1ex) / 2); }
  .seat-tag, .g-seat .tg span, .res-tags .mayor-pill, .role-pill { --ph: 15px; }
  .g-role .mayor-pill, .role-sheet .mayor-pill, .vote-tags .mayor-pill, .tag, .pf-res { --ph: 19px; }
  .nb-pill { --ph: 14px; }
  .pf-dots .nb-pill, .pf-opts .nb-pill, .pf-pass h1 .nb-pill { --ph: 17px; }
  .pf-vip, .host-tag { --ph: 18px; }
  .pf-vip.mini { --ph: 13px; }
  .md-wait, .pf-gname { --ph: 16px; }
  .pf-this { --ph: 28px; }
}

/* звук: динамик в шапке справа от темы, по нажатию окошко с переключателем и громкостью (sound.js) */
.snd { position: relative; flex: none; }
.snd-btn { width: 38px; height: 38px; padding: 0; display: grid; place-items: center; border-radius: 50%; background: transparent; color: var(--head-text); }
.snd-btn:hover, .snd-btn[aria-expanded="true"] { background: var(--head-soft); }
.snd-btn .ic { width: 21px; height: 21px; }
.snd-pop { position: absolute; right: 0; top: calc(100% + 8px); z-index: 20; width: 240px; box-sizing: border-box; display: grid; gap: 12px;
  background: var(--card); color: var(--text); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 14px 40px rgba(0,0,0,.2); padding: 14px; }
.snd-pop[hidden] { display: none; }
.snd-row { display: flex; align-items: center; justify-content: space-between; margin: 0; font-size: 15px; font-weight: 600; color: var(--text); }
.snd-vol { display: grid; gap: 6px; margin: 0; font-size: 13px; color: var(--muted); }
.snd-vol.off { opacity: .45; }
.snd-vol input { width: 100%; margin: 0; padding: 0; accent-color: var(--accent); }
.snd-test { justify-self: start; margin: 0; }
.snd-note { margin: 0; font-size: 12px; color: var(--muted); }
/* переключатель вместо галочки */
.snd .switch, .switch.pi-switch { appearance: none; -webkit-appearance: none; position: relative; width: 40px; height: 22px; margin: 0; padding: 0; border: 0; border-radius: 11px;
  background: var(--line); cursor: pointer; transition: background .15s; flex: none; }
.snd .switch::after, .switch.pi-switch::after { content: ""; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .15s; }
.snd .switch:checked, .switch.pi-switch:checked { background: var(--accent); }
.snd .switch:checked::after, .switch.pi-switch:checked::after { transform: translateX(18px); }
/* у ползунка нет галки: общее правило галочек в тёмной теме сильнее и рисовало её внутри (владелец, 28 октября 2026) */
.snd .switch, .switch.pi-switch, .snd .switch:checked, .switch.pi-switch:checked { background-image: none !important; }
/* в карточке лобби ползунок мельче, чем у звука в шапке: строка там в 13.5px */
.switch.pi-switch { width: 34px; height: 20px; border-radius: 10px; }
.switch.pi-switch::after { width: 14px; height: 14px; }
.switch.pi-switch:checked::after { transform: translateX(14px); }
/* переключатель «Подсказки» ведущего в карточке лобби — к правому краю строки */
.play-info .pi-switch { margin-left: auto; }
@media (max-width: 640px) { .snd-btn { width: 34px; height: 34px; } }
/* узкий телефон: вместо головы — надпись BGOlive помельче (владелец: голов в шапке и так много —
   профиль, кружок поддержки), на компьютере знак и надпись как были */
@media (max-width: 430px) {
  .top-inner { gap: 8px; }
  .top a.brand { font-size: 21px; }
  .top a.brand img.logo { display: none; }
  .theme-pick select { font-size: 13px; padding-left: 8px; padding-right: 4px; max-width: 150px; }
  /* «Войти» у того, кто не вошёл, шире кружка профиля и на 360 px упиралась в край */
  .top .login-btn { padding: 7px 12px; font-size: 14px; }
}

.nowrap { white-space: nowrap; }

/* «Как считаются голоса» в окне голосования: редкие случаи, свёрнуто */
.vote-rules { margin-top: 8px; font-size: 13px; color: var(--muted); }
.vote-rules summary { cursor: pointer; color: var(--accent); font-weight: 600; width: max-content; }
.vote-rules ul { margin: 6px 0 0; padding-left: 18px; display: grid; gap: 3px; }

/* --- обратная связь (docs/design/feedback.html, «C. Плавающий кружок») ------------------------- */
/* кружок с довольной фигуркой в наушниках (support-icon.html, 6) в правом нижнем углу; на странице комнаты его нет — закрывал бы
   «Отправить» в чате, там вместо него жучок (в лобби у «Как играть», за столом в углу стола) */
.fb-float { position: fixed; right: 18px; bottom: 18px; z-index: 30; display: flex; align-items: center; padding: 0; background: transparent; border: 0; }
.fb-float .fb-ring { position: relative; width: 54px; height: 54px; border-radius: 50%; background: var(--head); border: 2px solid var(--card);
                     box-shadow: 0 6px 18px rgba(0, 0, 0, .25); transition: transform .15s; }
.fb-float .fb-ring img { display: block; width: 100%; height: 100%; border-radius: 50%; }
.fb-float .fb-tip { margin-right: 8px; padding: 6px 12px; border-radius: 999px; background: var(--card); color: var(--text); border: 1px solid var(--line);
                    font-size: 13px; font-weight: 500; white-space: nowrap; box-shadow: 0 4px 12px rgba(0, 0, 0, .12);
                    opacity: 0; transform: translateX(6px); transition: opacity .15s, transform .15s; pointer-events: none; }
.fb-float:hover .fb-ring, .fb-float:focus-visible .fb-ring { transform: scale(1.06); }
.fb-float:hover .fb-tip, .fb-float:focus-visible .fb-tip { opacity: 1; transform: none; }
body.room-page .fb-float { display: none; }
/* жучок «Сообщить об ошибке» в углу стола — только за столом; в лобби он у «Как играть» (#report-lobby) */
body:not(.in-game) #report { display: none; }
/* низ страницы не уходит под кружок (на странице комнаты кружка нет) */
body:not(.room-page) main { margin-bottom: 88px; }
/* подвал со ссылкой на бота (common.js); низ под кружок теперь держит он */
.site-foot { padding: 8px 16px 88px; text-align: center; font-size: 14px; }
.site-foot a { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); text-decoration: none; }
.site-foot a:hover { color: var(--accent); }
.site-foot svg { width: 18px; height: 18px; color: #229ED9; }
.site-version { margin-top: 6px; font-size: 12px; color: var(--muted); opacity: .75; }
body:not(.room-page):has(.site-foot) main { margin-bottom: 24px; }
body.room-page .site-foot { display: none; }
/* на главной бот отдельным блоком «Мы в Telegram»: ссылка в подвале не нужна, версия остаётся */
body:has(#tg-card:not([hidden])) .site-foot a { display: none; }
body:has(#tg-card:not([hidden])) .site-version { margin-top: 0; }
.tg-card .muted { margin: -4px 0 12px; font-size: 14px; }
.tg-card .tg-btn svg { width: 20px; height: 20px; }
@media (max-width: 600px) {
  .fb-float { right: 12px; bottom: 12px; }
  .fb-float .fb-ring { width: 46px; height: 46px; }
  .fb-float .fb-tip { display: none; }
}
@media (prefers-reduced-motion: reduce) { .fb-float .fb-ring, .fb-float .fb-tip { transition: none; } }

dialog.fb-dialog { width: min(420px, calc(100vw - 32px)); }
/* окна с полями ввода не выше видимой части экрана и прокручиваются внутри: на телефоне клавиатура
   съедает полэкрана, и без этого поля вылезали за рамку окна (владелец, 28 октября 2026) */
dialog.fb-dialog, dialog.acc-dialog, dialog#login-dialog { max-height: calc(100vh - 32px); overflow-y: auto; overflow-x: hidden; }
@supports (height: 100dvh) { dialog.fb-dialog, dialog.acc-dialog, dialog#login-dialog { max-height: calc(100dvh - 32px); } }
.fb-lead { margin: 2px 0 0; }
.fb-kinds { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0 10px; }
.fb-kinds button { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px; background: var(--soft); color: var(--text);
                   border: 2px solid transparent; font-weight: 500; font-size: 14px; }
.fb-kinds button span { font-size: 20px; line-height: 1.1; }
.fb-kinds button.on { border-color: var(--accent); background: var(--card); }
.fb-dialog textarea { display: block; min-height: 110px; resize: vertical; }
.fb-count { display: block; text-align: right; font-size: 12px; color: var(--muted); margin-top: 2px; }
dialog.fb-dialog button.fb-attach { display: block; width: 100%; margin-top: 8px; border: 1px dashed var(--line); font-weight: 500; }
/* до трёх скриншотов в ряд, каждый со своим ✕ */
.fb-shots { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.fb-shot { position: relative; width: fit-content; }
.fb-shot img { display: block; max-width: 100%; height: 96px; border-radius: 8px; border: 1px solid var(--line); object-fit: cover; }
.fb-shot button { position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; padding: 0; border-radius: 50%; background: var(--card); box-shadow: 0 1px 4px rgba(0, 0, 0, .25); }
/* сильнее общего dialog.modal button[type=submit] с его отступом 4px */
dialog.fb-dialog button.fb-send { width: 100%; margin-top: 18px; }
.fb-done { text-align: center; }
.fb-done .fb-ring { display: block; width: 112px; height: 112px; margin: 6px auto 12px; border-radius: 50%; overflow: hidden; background: var(--soft); }
.fb-done .fb-ring img { display: block; width: 100%; height: 100%; }
.fb-done h2 { margin: 0 0 6px; }
.fb-done p { margin: 0 0 16px; }

/* --- телефон за столом (docs/design/phone-table.html, вариант B; выбор владельца 9 октября 2026) ---
   Экран без прокрутки: сверху строка роли и кнопки, под ней кнопка фазы, стол, снизу шторка с
   вкладками «Вопросы · Чат». Высоту стола считает renderTable (secret_word.js). Компьютер не меняется. */
.phone-only, .side-tabs, .side-strip { display: none; }
@media (max-width: 760px) {
  body.in-game main.wide { margin: 0; padding: 0; }
  body.in-game .room { gap: 0; }
  body.in-game .table-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "role tools" "act act" "ask ask" "stage stage";
    /* строки шапки по содержимому: у углов min-height 0, и строки «auto» схлопывались в ноль, когда стол
       не влезал, — панель вопроса и кнопки ответа ложились поверх «Ваш ход» */
    grid-template-rows: min-content min-content min-content minmax(0, 1fr);
    align-content: start; gap: 8px; padding: 8px 8px 0; border-radius: 0; border-width: 0; }
  body.in-game .table-card .corner { position: static; transform: none; width: auto !important; min-height: 0 !important; left: auto !important; right: auto !important; top: auto !important; }
  /* плашка по своему содержимому: без «Паузы» (после итога) растягивалась до «⋯» */
  body.in-game #g-role { grid-area: role; min-width: 0; justify-self: start; max-width: 100%; }
  /* выше «Задать вопрос Главе»: меню «⋯» открывается поверх него */
  body.in-game #g-tools { grid-area: tools; gap: 0; position: relative; z-index: 6; }
  body.in-game #g-action { grid-area: act; justify-items: stretch; }
  body.in-game #g-action:empty { display: none; }
  body.in-game #g-action .ask-mayor { width: 100%; }
  body.in-game .g-ask { grid-area: ask; position: static; width: auto !important; }
  body.in-game .g-ask .ask-sub { font-size: 12px; }
  /* стол прижат к низу: шапка разной высоты меняет только пустое место над ним (renderTable) */
  body.in-game #g-stage { grid-area: stage; justify-self: center; align-self: end; margin-top: 0 !important; }
  /* правила, жучок, настройки, выход и «⋯» ведущего — в одном «⋯»; «Пауза» на месте */
  body.in-game #g-tools > #g-rules, body.in-game #g-tools > #report, body.in-game #g-tools > #open-settings,
  body.in-game #g-tools > #leave, body.in-game #g-tools > #more-wrap { display: none; }
  body.in-game #g-more-wrap { display: inline-block; }
  body.in-game #g-tools #g-pause { padding: 4px 8px; font-size: 13px; }
  /* плашка роли — строкой: кружок поменьше, роль и слово рядом */
  body.in-game .g-role { grid-template-columns: 36px minmax(0, 1fr); gap: 8px; padding: 4px 36px 4px 4px; border-radius: 22px; }
  body.in-game .g-role .ava { width: 36px; height: 36px; border-width: 2px; }
  body.in-game .g-role .ava img { height: 66px; top: 2px; }
  body.in-game .g-role .ava img.throne { height: 87px; top: -11px; }
  body.in-game .g-role.role-villager .ava img.throne { height: 71px; top: -10px; }
  body.in-game .g-role.role-villager .ava img:not(.throne) { height: 54px; top: 1px; }
  body.in-game .g-role small { font-size: 0; gap: 0; }
  body.in-game .g-role small .mayor-pill { font-size: 10px; margin-right: 4px; }
  body.in-game .g-role > div:last-child { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 6px; min-width: 0; line-height: 1.2; }
  body.in-game .g-role b { font-size: 15px; display: inline-flex; align-items: center; gap: 4px; }
  body.in-game .g-role .g-word { font-size: 12.5px; margin: 0; }
  body.in-game .g-role .g-word b { font-size: 13px; }
  body.in-game .g-role .muted { font-size: 11.5px; }
  body.in-game .secret-wrap .secret-eye { top: 50%; right: 4px; transform: translateY(-50%); width: 26px; height: 26px; }
  /* шторка: вкладки «Вопросы · Чат», видна одна */
  body.in-game .side { height: 36dvh !important; min-height: 220px; gap: 0; background: var(--card); border-top: 1px solid var(--line);
    border-radius: 16px 16px 0 0; box-shadow: 0 -6px 18px rgba(0, 0, 0, .08); overflow: hidden; }
  body.in-game .side-tabs { display: flex; flex: none; border-bottom: 1px solid var(--line); padding: 0 8px; }
  /* шторку можно свернуть до вкладок: стол крупнее (просьба владельца) */
  body.in-game .side-tabs .side-fold { flex: none; width: 44px; padding: 0; border-bottom: 0; color: var(--muted); }
  body.in-game .side-fold svg { transition: transform .2s; }
  body.in-game .side.folded .side-fold svg { transform: rotate(180deg); }
  body.in-game .side.folded { height: auto !important; min-height: 0; }
  body.in-game .side.folded .feed, body.in-game .side.folded .chat { display: none; }
  body.in-game .side.folded .side-tabs { border-bottom: 0; }
  /* вкладки — переключатель: выбранная на подложке, а не тонкой чертой (владелец: «слабо выделяются»).
     Подсветка видна и в свёрнутой шторке: по ней понятно, что откроется */
  body.in-game .side-tabs { gap: 4px; padding: 6px 8px; align-items: center; }
  body.in-game .side-tabs button[data-tab] { border-bottom: 0; border-radius: 10px; padding: 8px 0; }
  body.in-game .side-tabs button[data-tab][aria-selected="true"] { background: color-mix(in srgb, var(--accent) 20%, transparent);
    color: var(--text); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--accent) 55%, transparent); }
  body.in-game .side-tabs .side-full, body.in-game .side-tabs .side-fold { height: 38px; border-radius: 10px; }
  /* «Во весь экран»: та же шторка поверх стола, листать вопросы и чат удобнее (просьба владельца) */
  body.in-game .side-tabs .side-full { flex: none; width: 44px; padding: 0; border-bottom: 0; color: var(--muted); }
  body.in-game .side.full { position: fixed; z-index: 40; left: 0; right: 0; top: max(12px, env(safe-area-inset-top)); bottom: 0;
    height: auto !important; min-height: 0; border-radius: 18px 18px 0 0; box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .45), 0 -6px 24px rgba(0, 0, 0, .3);
    animation: side-up .22s ease-out; }
  body.in-game .side.full .side-fold { display: none; }
  body.in-game .side.full .side-tabs { padding-top: 10px; }
  body.in-game .side.full .feed, body.in-game .side.full .chat { display: flex; }
  body.in-game .side.full[data-tab="feed"] .chat, body.in-game .side.full[data-tab="chat"] .feed { display: none; }
  /* «Самозванец»: третья вкладка «Слова» — доска во всю высоту окна */
  body.in-game .side.full[data-tab="words"] .feed, body.in-game .side.full[data-tab="words"] .chat { display: none; }
  body.in-game .side.full[data-tab="words"] .words-pane { display: flex; flex: 1; min-height: 0; }
  .words-pane .im-cork { flex: 1; min-height: 0; max-height: none; border-radius: 0; border-width: 6px; box-shadow: none; padding: 10px; }
  .words-pane .im-note { width: calc(50% - 8px); font-size: 14.5px; }
  .words-pane .im-notes { gap: 10px; }
  @keyframes side-up { from { transform: translateY(30%); opacity: .4; } }
  /* «Карточка на лбу»: шторка всегда свёрнута до двух кнопок, вкладка открывается во весь экран */
  body.in-game.sheet-modal .side[data-tab]:not(.full) { height: auto !important; min-height: 0; }
  body.in-game.sheet-modal .side[data-tab]:not(.full) .feed, body.in-game.sheet-modal .side[data-tab]:not(.full) .chat { display: none; }
  body.in-game.sheet-modal .side-fold, body.in-game.sheet-modal .side:not(.full) .side-full { display: none; }
  body.in-game.sheet-modal .side:not(.full) .side-tabs { border-bottom: 0; padding: 8px 8px max(8px, env(safe-area-inset-bottom)); gap: 8px; }
  body.in-game.sheet-modal .side:not(.full) .side-tabs button[data-tab] { background: var(--soft); color: var(--text); box-shadow: none; padding: 10px 0; }
  /* остаток жетонов над кнопками; во весь экран он и так в шапке ленты */
  body.in-game.sheet-modal .side:not(.full) .side-strip:not([hidden]) { display: block; padding: 8px 8px 0; }
  body.in-game .side-strip .counters { margin: 0; }
  /* «Глава ответил» тому, кто спросил: над кнопками внизу, сама уходит через 4 секунды */
  .sw-answer { position: fixed; z-index: 30; left: 50%; bottom: 128px; transform: translateX(-50%); max-width: calc(100vw - 24px);
    display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 14px; background: var(--card); color: var(--text);
    border: 1px solid var(--line); box-shadow: 0 8px 22px rgba(0, 0, 0, .3); font-size: 13.5px; animation: sw-answer-in .3s ease-out; }
  .sw-answer-t { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .sw-answer .tok { flex: none; }
  @keyframes sw-answer-in { from { transform: translate(-50%, 20px); opacity: 0; } }
  body.in-game .side-strip .cnt-row { justify-content: center; }
  /* плашка роли по содержимому: имя и слово столбиком. В одну строку с переносом она тянулась
     на всю ширину, хотя слово уже ушло на вторую строку */
  body.in-game .g-role > div:last-child { display: grid; justify-items: start; row-gap: 1px; }
  body.in-game .side-tabs button { flex: 1; background: transparent; color: var(--muted); border-radius: 0; padding: 10px 0 8px; font-weight: 600;
    border-bottom: 2px solid transparent; display: inline-flex; justify-content: center; align-items: center; gap: 6px; }
  body.in-game .side-tabs button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); }
  body.in-game .side-tabs .unread { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: #C0392B; color: #fff; font-size: 11px; line-height: 18px; }
  body.in-game .side .feed, body.in-game .side .chat { flex: 1 1 0; height: auto; min-height: 0; margin: 0; border: 0; border-radius: 0; padding: 8px 12px; }
  body.in-game .side[data-tab="feed"] .chat, body.in-game .side[data-tab="chat"] .feed { display: none; }
  body.in-game .feed-head h2, body.in-game #feed-ask { display: none; }
  body.in-game .chat-head h2 { font-size: 13px; color: var(--muted); font-weight: 600; }
  /* остаток жетонов в шторке — одной строкой, без подписи (вкладка и так «Вопросы») */
  body.in-game .counters small { display: none; }
  body.in-game .cnt-row { flex-wrap: nowrap; gap: 4px; }
  body.in-game .cnt { font-size: 11.5px; gap: 3px; padding: 2px 7px 2px 3px; white-space: nowrap; }
  body.in-game .cnt .sign { width: 16px; height: 16px; font-size: 10px; }
  body.in-game .cnt b { font-size: 12.5px; }
  body.in-game .lvl { font-size: 11.5px; padding: 2px 8px; gap: 3px; }
  body.in-game .lvl-k { display: none; }
  /* рядом со сложностью строка не помещается: у редких жетонов только значок и число, как на столе */
  body.in-game .cnt:not(.cnt-yes) .cnt-t { display: none; }
  /* «Пауза» — значком: иначе плашка роли переносилась в три строки */
  body.in-game #g-tools #g-pause { padding: 5px 9px; }
  body.in-game #g-tools #g-pause .lbl { display: none; }
  /* центр маленького стола: надписи мельче, чтобы не вылезали за край */
  body.in-game .stage .c-ph { font-size: 10px; }
  body.in-game .stage .c-clock { font-size: 22px; padding: 4px 8px; }
  body.in-game .stage .c-word { font-size: 15px; padding: 2px 10px; }
  body.in-game .stage .c-note { font-size: 12px; }
  body.in-game .stage .c-big { font-size: 15px; }
  body.in-game .stage .c-result { font-size: 16px; }
  body.in-game .stage .c-said { font-size: 13px; }
  body.in-game .stage .verdict { transform: scale(.8); margin: -4px 0; white-space: nowrap; }
  /* после итога «Итог раунда» и «Ещё раунд» рядом */
  body.in-game #g-action:has(> .ask-soft) { grid-template-columns: 1fr 1fr; align-items: stretch; }
  body.in-game #g-action > .plain.small, body.in-game #g-action > .ask-soft { width: 100%; justify-content: center; margin: 0; }
  /* окно итога: шапка, слово и сразу кнопки; фигурки ролей ниже — их смотрят, если интересно (владелец) */
  .result-dialog .res-word { order: 0; }
  .result-dialog .res-btns { order: 1; }
  .result-dialog .res-grid { order: 2; }
}

/* --- регистрация и вход через Telegram (docs/design/telegram-login.html, static/account.js) --- */
.login-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 12px; font-size: 13.5px; }
.tg-link { display: inline-flex; align-items: center; gap: 6px; color: #1B8BC9; font-weight: 600; }
.tg-link::before { content: ""; width: 15px; height: 15px; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M21.5 3.6 2.9 10.8c-1.3.5-1.3 1.2-.2 1.6l4.8 1.5 1.8 5.6c.2.6.1.9.8.9.5 0 .7-.2 1-.5l2.4-2.3 4.9 3.6c.9.5 1.6.2 1.8-.8L23.4 5c.3-1.4-.5-2-1.9-1.4Z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M21.5 3.6 2.9 10.8c-1.3.5-1.3 1.2-.2 1.6l4.8 1.5 1.8 5.6c.2.6.1.9.8.9.5 0 .7-.2 1-.5l2.4-2.3 4.9 3.6c.9.5 1.6.2 1.8-.8L23.4 5c.3-1.4-.5-2-1.9-1.4Z'/%3E%3C/svg%3E") center / contain no-repeat; }
:root[data-theme="dusk"] .tg-link { color: #5EC2F2; }
.or-line { display: flex; align-items: center; gap: 10px; margin: 16px 0 8px; color: var(--muted); font-size: 12.5px; }
.or-line::before, .or-line::after { content: ""; flex: 1; height: 1px; background: var(--line); }
#anon-view .plain, #login-dialog .plain#dlg-register, .wide-plain { width: 100%; }
.entry-home { display: block; text-align: center; box-sizing: border-box; width: 100%; margin-top: 8px; }
.entry-login { text-align: center; }
.tg-ic { display: inline-flex; width: 18px; height: 18px; flex: none; }
.tg-ic svg { width: 100%; height: 100%; }
.tg-btn { display: flex; align-items: center; justify-content: center; gap: 9px; width: 100%; box-sizing: border-box; padding: 11px 14px; border-radius: 10px;
  background: #2AABEE; color: #fff; font-weight: 700; font-size: 15px; border: 0; text-decoration: none; white-space: nowrap; }
.tg-btn:hover { background: #229ED9; color: #fff; }
dialog.acc-dialog { width: min(400px, calc(100vw - 32px)); }
.acc-body { padding: 20px; display: grid; gap: 0; }
.acc-body > p { margin: 8px 0 0; }
.acc-note { font-size: 12.5px; margin: 6px 0 0; }
.acc-steps { display: flex; gap: 6px; align-items: center; font-size: 12px; color: var(--muted); margin: 2px 0 10px; }
.acc-steps i { width: 22px; height: 4px; border-radius: 2px; background: var(--line); }
.acc-steps i.on { background: #2AABEE; }
.acc-methods { display: grid; gap: 8px; margin-top: 10px; }
.acc-method { display: grid; grid-template-columns: 36px 1fr auto; gap: 12px; align-items: center; padding: 11px 12px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--card); color: var(--text); text-align: left; font-weight: 400; }
button.acc-method { border-color: #2AABEE; background: color-mix(in srgb, #2AABEE 8%, var(--card)); }
button.acc-method:hover { background: color-mix(in srgb, #2AABEE 16%, var(--card)); }
.acc-method.soon { opacity: .55; }
.acc-method b { display: block; font-size: 14.5px; } .acc-method small { color: var(--muted); font-size: 12.5px; }
.acc-ic { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--soft); font-size: 15px; font-weight: 800; color: var(--muted); }
.acc-ic.tg { background: #2AABEE; color: #fff; }
.acc-soon { font-size: 11px; padding: 1px 7px; border-radius: 8px; background: var(--soft); color: var(--muted); }
.acc-go { color: #1B8BC9; font-weight: 700; }
.acc-list { margin: 8px 0 0; padding-left: 20px; font-size: 14px; line-height: 1.5; }
/* у сайта списки строками с разделителями: здесь обычный нумерованный */
.acc-list li { display: list-item; margin: 3px 0; padding: 0; border: 0; background: none; }
.acc-qr-row { display: grid; grid-template-columns: 132px 1fr; gap: 16px; align-items: center; margin-top: 12px; }
.acc-qr { width: 132px; height: 132px; border-radius: 10px; border: 1px solid var(--line); background: #fff; }
.acc-qr-side { display: grid; gap: 8px; }
.acc-open { margin-top: 12px; }
.acc-wait { display: flex; align-items: center; gap: 10px; margin-top: 14px; padding: 10px 12px; border-radius: 10px; background: var(--soft); font-size: 13.5px; }
.acc-wait b { margin-left: auto; font-variant-numeric: tabular-nums; }
.acc-spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line); border-top-color: #2AABEE; flex: none; animation: acc-spin 1s linear infinite; }
@keyframes acc-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .acc-spin { animation: none; } }
.acc-links { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; font-size: 13px; }
.acc-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.acc-actions .tg-btn { width: 100%; }
/* форма внутри окна: отступы уже у окна (у dialog.modal form свои 20px) */
dialog.acc-dialog form.acc-form { display: grid; padding: 0; }
.acc-form label { display: block; margin: 10px 0 4px; font-size: 14px; }
/* «Запомнить меня» — строкой, галочка по центру строки (общая подпись формы — блоком) */
dialog.acc-dialog .acc-form label.check { display: flex; align-items: center; gap: 10px; margin: 14px 0 0; }
/* главная кнопка отделена от последнего поля, как в окне входа */
dialog.acc-dialog .acc-form button[type=submit] { margin-top: 18px; }
.acc-form .error { margin: 8px 0 0; }
.acc-hint { font-size: 12.5px; margin-top: 4px; min-height: 0; }
/* подсказка между подписью и полем: требования к полю до ввода */
.acc-field-hint { font-size: 12.5px; margin: -2px 0 6px; }
.acc-hint.ok { color: #2E8B57; } .acc-hint.bad { color: #C0392B; }
.acc-done { padding: 8px 10px; border-radius: 10px; background: color-mix(in srgb, #2E8B57 12%, transparent); color: #2E8B57; font-size: 13px; font-weight: 600; margin-bottom: 4px; }
/* профиль: способы входа */
.pf-ways { display: grid; gap: 8px; max-width: 560px; }
.pf-way { display: grid; grid-template-columns: 36px 1fr auto; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 12px; background: var(--soft); }
.pf-way b { display: block; font-size: 14.5px; } .pf-way small { color: var(--muted); font-size: 12.5px; }
.pf-way-ic { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--card); font-size: 17px; }
.pf-way-ic.tg { background: #2AABEE; color: #fff; }
.pf-way-ok { color: #2E8B57; font-weight: 700; }

/* --- окно «Во что играем?» при создании комнаты (docs/design/game-pick.html, A; static/gamepick.js) --- */
.gp-search { width: 100%; margin: 8px 0 4px; box-sizing: border-box; }
.gp-list { display: grid; gap: 8px; margin-top: 10px; max-height: min(60vh, 520px); overflow-y: auto; }
.gp-game { display: flex; gap: 12px; align-items: center; width: 100%; box-sizing: border-box; padding: 10px 12px; text-align: left;
  border: 1px solid var(--line); border-radius: 12px; background: var(--card); color: var(--text); font: inherit; font-weight: normal; white-space: normal; cursor: pointer; }
button.gp-game:hover, button.gp-game:focus-visible { border-color: var(--accent); background: var(--card); }
.gp-game img { width: 52px; height: 52px; object-fit: contain; flex: none; }
.gp-text { flex: 1; min-width: 0; }
.gp-text b { display: block; font-size: 16px; }
.gp-text small { display: block; color: var(--muted); font-size: 13px; line-height: 1.35; }
.gp-meta { display: block; font-size: 12px; color: var(--muted); margin-top: 3px; }
.gp-go { color: var(--accent); font-size: 20px; flex: none; }
.gp-game.soon { opacity: .55; border-style: dashed; cursor: default; }
.gp-game.soon .gp-go { font-size: 12px; color: var(--muted); }
.gp-empty { margin: 12px 0 0; }

/* --- «Кто мы?» за столом (docs/design/who-are-we.html, A; static/forehead_card.js) --------------- */
/* бумажка над головой игрока: его слово, своя — «?»; угадавшему — зелёная с местом */
.w-note { position: relative; z-index: 2; display: inline-block; margin-bottom: -6px; padding: 4px 8px; min-width: 58px; max-width: 120px;
  background: #FFF1A8; color: #2B2412; border-radius: 3px; font-size: 13px; font-weight: 700; line-height: 1.15; text-align: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, .25); transform: rotate(-3deg); overflow-wrap: anywhere; hyphens: auto; }
.w-seat:nth-child(odd) .w-note { transform: rotate(2.5deg); }
.w-note.mine { background: var(--card); color: var(--muted); border: 2px dashed var(--muted); box-shadow: none; font-size: 17px; padding: 1px 10px; }
.w-note.guessed { background: #CDE8B5; }
.w-note.guessed::before { content: "✓ "; color: #2E7D32; }
.w-note.writing { background: var(--soft); color: var(--muted); font-weight: 500; font-style: italic; box-shadow: none; }
.w-note .place { display: block; font-size: 10px; font-weight: 600; color: #2E7D32; }
.w-seat.done .fig { filter: saturate(.45) opacity(.8); }
/* ход (docs/design/turn-highlight.html, B + D + свечение A): стрелка со стола, фигурка покачивается,
   под табуретом мягкий свет вместо черты */
.w-seat.picked .pic::after { content: none; }
.w-seat.picked .pic::before { content: ""; position: absolute; left: 50%; bottom: -10%; width: 150%; height: 40%; transform: translateX(-50%);
  border-radius: 50%; background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 50%, transparent), transparent); }
.w-seat.picked .pic .fig { animation: w-sway 1.6s ease-in-out infinite; transform-origin: 50% 100%; }
@keyframes w-sway { 0%, 100% { transform: translateX(-50%) rotate(-3deg); } 50% { transform: translateX(-50%) rotate(3deg); } }
.fc-stage .w-arrow { position: absolute; left: 50%; top: 50%; width: 0; height: 0; pointer-events: none; transition: transform .7s cubic-bezier(.3, 1.3, .5, 1); }
.fc-stage .w-arrow i { position: absolute; top: calc(-7px * var(--k)); height: calc(14px * var(--k)); border-radius: 7px; transition: left .7s, width .7s;
  background: linear-gradient(90deg, transparent, rgba(244, 235, 221, .5) 35%, #F4EBDD); }
.fc-stage .w-arrow i::after { content: ""; position: absolute; right: calc(-15px * var(--k)); top: calc(-6px * var(--k));
  border-style: solid; border-color: transparent transparent transparent #F4EBDD; border-width: calc(13px * var(--k)) 0 calc(13px * var(--k)) calc(17px * var(--k)); }
@media (prefers-reduced-motion: reduce) { .w-seat.picked .pic .fig { animation: none; } .fc-stage .w-arrow, .fc-stage .w-arrow i { transition: none; } }

/* ответы «Да / Нет / Не знаю»: плашки и кнопки */
.wa { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 10px; font-size: 12.5px; font-weight: 700; color: #fff;
  background: #7A8794; white-space: nowrap; line-height: 1.35; }
.wa.sm { font-size: 10.5px; padding: 0 6px; line-height: 15px; }
/* лента «Вопросы за столом» мельче: на много игроков в неё влезает больше строк (владелец, 29 октября 2026) */
body.fc-game #questions .q { padding: 6px 0; gap: 4px; }
body.fc-game #questions .q-line { font-size: 13.5px; line-height: 1.35; }
body.fc-game #questions .wa { font-size: 11.5px; padding: 1px 8px; }
.wa-yes { background: #2E8B57; } .wa-no { background: #C0392B; } .wa-idk { background: #7A8794; }
/* никто не ответил: блёклая, не путается с «Не знаю» — ход ушёл дальше */
.wa-none { background: transparent; color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); font-weight: 600; }
/* «Угадал!» — золотом, как кубок победы */
.wa-got { background: #C98A0B; }
.g-seat .tg .wa { color: #fff; }
.g-seat .tg .wa-yes { background: #2E8B57; } .g-seat .tg .wa-no { background: #C0392B; } .g-seat .tg .wa-idk { background: #7A8794; }
.g-seat .tg .wa-got { background: #C98A0B; }
.w-answers { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
.wa-btn { padding: 8px 16px; border-radius: 10px; font-weight: 700; color: #fff; border: 0; }
.wa-btn.wa-yes { background: #2E8B57; } .wa-btn.wa-no { background: #C0392B; } .wa-btn.wa-idk { background: #7A8794; }
.wa-btn.wa-got { background: #C98A0B; }
.wa-btn.picked { outline: 3px solid #F3EBDD; outline-offset: 2px; }

/* центр стола: вопрос ходящего крупно, под ним кнопки и кто что ответил */
.stage .w-q { background: var(--card); color: var(--text); border-radius: 14px; padding: 9px 14px; font-size: 18px; font-weight: 600;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .3); max-width: 100%; overflow-wrap: anywhere; }
.stage .w-q.voice { font-size: 15px; font-weight: 500; color: var(--muted); }
/* облачко — кнопка: открывает вопрос целиком */
.stage button.w-q { display: block; font-family: inherit; line-height: 1.3; text-align: center; cursor: pointer; }
.stage button.w-q:hover { filter: brightness(1.04); }
/* окно вопроса */
dialog.fc-q-dialog { width: min(440px, calc(100vw - 32px)); }
.fc-q-dialog form { display: grid; gap: 12px; }
.fc-q-dialog p { margin: 0; }
.fc-q-text { font-size: 19px; font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; }
.fc-q-text.voice { color: #6B5E2A; font-weight: 600; }
/* окно вопроса: вопрос на жёлтой бумажке, как слова на лбу; фон за окном темнее и размыт —
   в тёмной теме окно сливалось с затемнённым столом (docs/design/question-dialog.html, C) */
.q-paper { display: grid; gap: 4px; padding: 12px 14px; border-radius: 4px; background: #FFF1A8; color: #2B2412;
  box-shadow: 0 3px 8px rgba(0, 0, 0, .3); transform: rotate(-1deg); }
.q-paper-who { font-size: 12.5px; color: #7A6A2E; font-weight: 600; overflow-wrap: anywhere; }
.q-paper .fc-q-text { color: #2B2412; }
.q-paper.long .fc-q-text { font-size: 16px; }
.q-paper.xlong .fc-q-text { font-size: 14.5px; line-height: 1.3; }
dialog.fc-q-dialog { max-height: calc(100vh - 24px); overflow-y: auto; box-shadow: 0 18px 40px rgba(0, 0, 0, .5); }
@supports (height: 100dvh) { dialog.fc-q-dialog { max-height: calc(100dvh - 24px); } }
dialog.fc-q-dialog::backdrop { background: rgba(4, 8, 16, .7); backdrop-filter: blur(3px); }
.fc-q-answers { flex-wrap: nowrap; }
.fc-q-answers .wa-btn { flex: 1; padding: 11px 0; font-size: 15px; }
.fc-q-answers .wa-btn.picked { outline-color: var(--text); }
.fc-q-head { display: flex; align-items: center; gap: 8px; }
.fc-q-num { min-width: 30px; padding: 2px 10px; border-radius: 10px; background: var(--accent); color: var(--accent-text); font-size: .85em; text-align: center; }
.fc-q-dialog .w-tally { margin-top: 8px; padding-top: 14px; border-top: 1px solid var(--line); }
.fc-q-dialog .w-tally span { background: var(--soft); color: var(--text); }
.fc-q-dialog .w-tally .w-clock { background: var(--soft); color: var(--text); }
/* «Тайное слово»: вопрос в ленте нажимается, окно вопроса с жетонами */
.q.tap { cursor: pointer; }
.q.tap:hover .q-text { text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
.sw-q-answer { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-weight: 600; }
.sw-q-dialog .tok-row { display: flex; flex-wrap: wrap; gap: 6px; }
.sw-q-dialog .counters small { display: block; color: var(--muted); font-size: 12px; margin-bottom: 4px; }
/* окно жетона за вопрос вслух на телефоне: кольцо жетонов вокруг фигурки (token-dialog.html, C) */
.sw-ring { position: relative; height: 280px; }
.sw-ring-mid { position: absolute; left: 50%; top: 48%; transform: translate(-50%, -50%); display: grid; justify-items: center; gap: 4px; max-width: 130px; text-align: center; }
.sw-ring-mid b { color: var(--accent); font-size: 17px; overflow-wrap: anywhere; line-height: 1.15; }
.sw-ring-ava { position: relative; width: 74px; height: 74px; border-radius: 50%; overflow: hidden; border: 2px solid var(--accent); background: var(--soft); }
.sw-ring-ava img { position: absolute; left: 50%; top: 5px; height: 132px; transform: translateX(-50%); }
.sw-ring .ring-tok i { color: var(--text); background: var(--card); padding: 0 4px; border-radius: 6px; }
/* «Позже» внизу окна вопроса: отделено чертой, заметная кнопка, а не серая надпись (владелец) */
.sw-q-foot { display: grid; justify-items: center; gap: 14px; margin-top: 6px; }
.sw-q-foot::before { content: ""; width: 100%; height: 2px; border-radius: 1px; background: color-mix(in srgb, var(--text) 35%, transparent); }
.sw-q-later { min-width: 110px; padding: 6px 18px; border-radius: 9px; font-size: 14px; font-weight: 600; background: var(--soft); color: var(--muted);
  border: 1px solid var(--line); }
.sw-q-later:hover { color: var(--text); border-color: var(--muted); }
/* кнопка Главы на телефоне: пульсирует, пока вопросы ждут ответа, счётчик в углу */
.sw-answer-btn { position: relative; animation: sw-pulse 1.4s ease-in-out infinite; }
.sw-wait-n { position: absolute; right: -5px; top: -7px; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: #C0392B;
  color: #fff; font-size: 12px; font-weight: 800; line-height: 20px; text-align: center; }
@keyframes sw-pulse { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 55%, transparent); } 50% { box-shadow: 0 0 0 7px color-mix(in srgb, var(--accent) 0%, transparent); } }
@media (prefers-reduced-motion: reduce) { .sw-answer-btn { animation: none; } }
/* остаток жетонов в ленте на компьютере компактнее: занимал половину колонки «Вопросы» (владелец) */
@media (min-width: 761px) {
  #feed-left .counters { gap: 4px; }
  #feed-left .counters small { font-size: 10.5px; }
  #feed-left .cnt-row { gap: 4px; }
  #feed-left .cnt { font-size: 11.5px; gap: 3px; padding: 1px 7px 1px 3px; }
  #feed-left .cnt .sign { width: 15px; height: 15px; font-size: 9.5px; }
  #feed-left .cnt b { font-size: 12px; }
  #feed-left .lvl { font-size: 11.5px; padding: 1px 8px; gap: 3px; }
  #feed-left .lvl-k { display: none; }
}
/* «Все / Мои» в ленте вопросов */
.fc-filter { display: inline-flex; gap: 2px; padding: 2px; border-radius: 10px; background: var(--soft); }
.fc-filter button { background: transparent; color: var(--muted); padding: 4px 12px; border-radius: 8px; font-size: 13px; font-weight: 600; }
.fc-filter button.on { background: var(--card); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .15); }
/* «Игрок»: список остальных (стрелка — сама у списка), выбранный ник на кнопке; длинный — многоточием, ширина не прыгает (владелец, 29 октября 2026) */
.fc-filter .fc-who { width: auto; max-width: 130px; margin: 0; border: 0; background-color: transparent; color: var(--muted); padding: 4px 6px 4px 10px;
                     border-radius: 8px; font-size: 13px; font-weight: 600; text-overflow: ellipsis; cursor: pointer; }
.fc-filter .fc-who.on { background-color: var(--card); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .15); }
/* облачко вопроса заметно на столе в любой теме: рамка цвета бумаги и тень (владелец: «сливается») */
.stage .w-q { border: 2px solid rgba(243, 235, 221, .9); box-shadow: 0 0 0 3px rgba(0, 0, 0, .25), 0 6px 18px rgba(0, 0, 0, .45); }
.w-tally { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; font-size: 12px; }
.w-tally span { background: rgba(0, 0, 0, .32); color: #fff; border-radius: 8px; padding: 2px 8px; }
.w-ask { display: flex; gap: 6px; width: 100%; }
.w-ask input { flex: 1; min-width: 0; }
.stage .center input[type=text] { background: var(--card); }
.stage .w-voice { background: var(--card); }
.stage .c-clock.small { font-size: 18px; padding: 4px 9px; }

/* «Ваша карточка» слева сверху: плашка в стиле плашки роли, вместо роли — бумажка «?» */
.g-role.fc-card .w-note { transform: none; margin: 4px 0 2px; font-size: 17px; }
.g-role.fc-card .w-note.guessed { font-size: 16px; }
.g-role.fc-card .ava img { height: 118px; top: 4px; }
/* «Что вы узнали» под карточкой: свои вопросы с ответами, прокрутка внутри */
.w-learned { position: absolute; left: 16px; z-index: 3; max-height: 46%; overflow-y: auto; padding: 10px 12px; border-radius: 14px;
  background: var(--card); border: 1px solid var(--line); }
.fc-learned h3 { margin: 0 0 6px; font-size: 14px; }
.fc-learned p { margin: 0; font-size: 13px; }
.wl-list { display: grid; gap: 5px; font-size: 13.5px; }
.wl-row { display: flex; gap: 8px; align-items: baseline; justify-content: space-between; }
.wl-row > span:first-child { overflow-wrap: anywhere; }

/* лента: свои вопросы жирнее */
.q.mine .q-text { font-weight: 600; }

/* окна «Вы пишете слово», «Я знаю, кто я» и итог партии */
dialog.fc-write-dialog { width: min(420px, calc(100vw - 32px)); }
.fc-write-dialog form { display: grid; gap: 10px; }
.fc-write-dialog p { margin: 0; }
.fc-to { display: flex; gap: 12px; align-items: center; }
.fc-to img { height: 56px; }
.fc-res { width: 100%; border-collapse: collapse; font-size: 14px; margin-bottom: 12px; }
.fc-res td { padding: 6px; border-top: 1px solid var(--line); }
.fc-res td.pl { font-weight: 700; width: 34px; text-align: center; }
.fc-res tr.me td { background: var(--soft); }
.fc-res .chip { display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 8px; background: var(--soft); color: var(--muted); white-space: nowrap; }

@media (max-width: 760px) {
  /* бумажки на телефоне крупнее: в 11px слова было не прочесть (владелец) */
  .w-note { font-size: 13px; padding: 2px 7px; min-width: 0; max-width: 108px; }
  .w-note.mine { font-size: 16px; padding: 0 8px; }
  .stage .w-q { font-size: 15px; padding: 7px 10px; }
  .wa-btn { padding: 7px 12px; }
  body.in-game .g-role.fc-card .w-note { margin: 0; font-size: 14px; }
  body.in-game .g-role.fc-card .ava img { height: 66px; top: 2px; }
  body.in-game .g-role.fc-card .muted { display: none; }
}
.w-tally .w-clock { font: 700 12px/1 ui-monospace, monospace; background: rgba(0, 0, 0, .45); padding: 3px 8px; }
.w-tally .w-clock.hurry { color: #FFB4A8; }
/* «Кто мы?»: общие часы партии под «чей ход» */
#g-action .w-left { margin: 0; }
.w-left-clock { font: 700 13px/1 ui-monospace, monospace; color: var(--text); }
.w-left-clock.hurry { color: var(--error); }
.w-dock { display: none; }
@media (max-width: 760px) {
  body.in-game .w-dock { display: grid; gap: 6px; }
  body.in-game .w-dock .w-answers { flex-wrap: nowrap; }
  body.in-game .w-dock .wa-btn { flex: 1; padding: 11px 0; font-size: 16px; }
  body.in-game .w-dock .wa-btn.picked { outline-color: var(--text); }
  body.in-game .w-dock .w-voice { justify-self: center; }
  body.in-game .stage .center { gap: 4px; }
  body.in-game .stage .w-tally { font-size: 10.5px; gap: 3px; }
}
/* «Что вы узнали» до низа стола: колонка во всю высоту */
.w-learned { max-height: none; }
.w-dock-wait { margin: 0; text-align: center; font-size: 13px; min-height: 40px; display: grid; place-items: center; }
@media (max-width: 760px) {
  /* панель в одну строку в любом состоянии (поле с 🎙, кнопки ответа, «Ждём…»): стол не прыгает */
  body.in-game .w-dock { min-height: 46px; align-content: center; }
  body.in-game #g-action { min-height: 40px; align-content: center; gap: 2px; }
  body.in-game .w-dock .w-ask button { padding-left: 14px; padding-right: 14px; }
  body.in-game .w-dock .w-voice-ic { flex: none; padding: 0 10px; font-size: 18px; }
  body.in-game .w-dock-wait { min-height: 0; }
}
/* невысокий телефон: шторка ниже, иначе стол между шапкой и шторкой сжимался до полоски */
@media (max-width: 760px) and (max-height: 760px) { body.in-game .side { height: 26dvh !important; min-height: 150px; } }
@media (max-width: 760px) {
  /* открыт чат — шторка до половины экрана, стол на это время меньше: в 26% чат не помещался.
     Только у шторки: в окнах во весь экран (sheet-modal) закрытый чат сжимал стол (находка владельца, 23 октября 2026) */
  body.in-game:not(.sheet-modal) .side[data-tab="chat"]:not(.folded):not(.full) { height: 46dvh !important; }
  /* «Чат · всем» повторяет вкладку и выбор «Кому»; заголовок нужен, только когда есть «✕ писать всем» */
  body.in-game .chat-head:has(#to-all[hidden]):has(#watchers[hidden]) { display: none; }
  body.in-game .compose { grid-template-columns: minmax(0, 92px) minmax(0, 1fr) auto; gap: 6px; margin-top: 8px; }
  body.in-game .compose:has(> select[hidden]) { grid-template-columns: minmax(0, 1fr) auto; }
  body.in-game .compose select { grid-column: auto; padding-left: 8px; padding-right: 4px; }
  body.in-game .compose button { padding-left: 12px; padding-right: 12px; }
  body.in-game .chat .error:empty { display: none; }
  /* номер вопроса — внутри облачка, длинный вопрос мельче, счётчики одной строкой */
  .stage .w-q .w-q-n { display: block; font-size: 10px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 1px; }
  .stage .w-q.long { font-size: 13px; line-height: 1.25; }
  .stage .w-q .w-q-t { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden; overflow-wrap: anywhere; }
  /* центр не шире стола: строка счётчиков шире него растягивала колонку, и облачко съезжало вправо */
  body.in-game .stage .center { grid-template-columns: minmax(0, 1fr); }
  body.in-game .stage .w-tally { gap: 3px; }
  /* прошлый вопрос с ответом на столе, пока думают над следующим */
  .stage .w-last { display: flex; align-items: center; gap: 6px; max-width: 100%; background: rgba(0, 0, 0, .35); border-radius: 10px;
    padding: 4px 6px 4px 10px; font-size: 12px; color: #F3EBDD; }
  .stage .w-last-q { min-width: 0; overflow: hidden; text-align: left; overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; }
  .stage .w-last .wa { flex: none; }
  body.in-game .stage .w-tally span { padding: 1px 5px; white-space: nowrap; }
  /* место «1-е место» над головой на телефоне не пишем: бумажка выросла и наезжала на стол */
  body.in-game .w-seat .w-note .place { display: none; }
  /* плашка «Ваша карточка» по содержимому: строка с местом и бумажка столбиком, а не в одну линию */
  body.in-game .g-role.fc-card small { width: auto; }
  body.in-game .g-role.fc-card > div:last-child { display: grid; justify-items: start; row-gap: 2px; }
}
/* место на телефоне мельче целиком (scale(--k)), а бумажка со словом и ник — нет: делим на --k,
   на экране они остаются читаемыми при любом размере стола (владелец: «мелкие капец») */
@media (max-width: 760px) {
  body.in-game .w-seat .w-note { font-size: calc(11px / var(--k)); width: max-content; max-width: calc(92px / var(--k)); hyphens: manual; padding: calc(2px / var(--k)) calc(6px / var(--k));
    border-radius: calc(3px / var(--k)); margin-bottom: calc(-3px / var(--k)); }
  body.in-game .w-seat .w-note.long { font-size: calc(9.5px / var(--k)); }
  body.in-game .w-seat .w-note.mine { font-size: calc(12px / var(--k)); padding: 0 calc(6px / var(--k)); border-width: calc(1.5px / var(--k)); }
  body.in-game .w-seat .w-note .place { font-size: calc(9px / var(--k)); }
  body.in-game .w-seat .nm { font-size: max(13px, calc(10.5px / var(--k))); max-width: calc(110px / var(--k)); }
  body.in-game .w-seat .tg .wa.sm { font-size: max(10.5px, calc(9px / var(--k))); line-height: 1.4; }
}
/* бумажка «?» в «Ваша карточка» во всю ширину плашки (просьба владельца) */
.g-role.fc-card .w-note { display: block; width: 100%; max-width: none; box-sizing: border-box; padding: 4px 8px; }
.w-note.long { font-size: 11px; max-width: 130px; }
.g-role.fc-card .w-note.long { font-size: 14px; }
@media (max-width: 760px) { .w-note.long { font-size: 11px; } }
@media (max-width: 760px) { body.in-game .g-role.fc-card .w-note { display: inline-block; width: auto; } }
/* место в «Ваша карточка»: золотая плашка справа в строке «Вы были» */
.g-role.fc-card small { width: 100%; }
.g-role .fc-place { margin-left: auto; padding: 1px 8px; border-radius: 8px; background: #C98A0B; color: #fff; font-weight: 800;
  font-size: 11px; letter-spacing: .02em; text-transform: none; }
@media (max-width: 760px) { body.in-game .g-role .fc-place { font-size: 10px; margin-left: 6px; } }
.g-role .fc-writer { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.g-role.fc-card > div:last-child { min-width: 0; }
/* четыре ответа одной строкой на столе: на низком окне вторая строка не помещалась в столешницу */
.stage .w-answers { flex-wrap: nowrap; gap: 5px; }
.stage .wa-btn { padding: 7px 12px; white-space: nowrap; }

/* --- игры: строка на главной и страница /games (docs/design/home-games.html, E); пункт в шапке владелец убрал --- */
.home-games { display: flex; align-items: center; gap: 10px; background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 10px 12px; margin-bottom: 16px; color: var(--text); text-decoration: none; font-size: 14px; }
.home-games[hidden] { display: none; }
.home-games:hover { border-color: var(--accent); }
.home-games .hg-faces { display: flex; flex: none; }
.home-games .hg-faces img { width: 34px; height: 34px; object-fit: contain; background: var(--soft); border-radius: 50%; border: 2px solid var(--card); margin-left: -8px; }
.home-games .hg-faces img:first-child { margin-left: 0; }
.home-games .hg-names { flex: 1; min-width: 0; line-height: 1.35; }
.home-games .hg-all { color: var(--accent); font-weight: 700; white-space: nowrap; }
main.gm { max-width: 920px; }
.gm h1 { margin: 0 0 4px; font-size: 28px; }
.gm-lead { margin: 0 0 14px; font-size: 15px; }
.gm-count { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 16px; font-size: 15px; }
.gm-count span { margin-right: 4px; }
.gm-count button { margin: 0; min-width: 40px; padding: 6px 10px; background: var(--card); color: var(--text); border: 1px solid var(--line);
  border-radius: 999px; font-size: 14px; font-weight: 600; }
.gm-count button:hover { border-color: var(--accent); }
.gm-count button.on { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.gm-back { display: inline-block; margin: 0 0 10px; font-size: 14px; font-weight: 600; text-decoration: none; }
.gm-back:hover { text-decoration: underline; }
/* карточки в ряду одной высоты, кнопка у всех внизу */
/* карточки по своей высоте и по столбцам .gm-col (layout в games.js): раскрытые правила одной сдвигают вниз только
   её столбец (отзыв № 9) */
.gm-list { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); align-items: start; }
.gm-col { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.gm-head { display: flex; flex-direction: column; gap: 6px; }
.gm-game { position: relative; display: flex; flex-direction: column; gap: 6px; background: var(--card); border: 1px solid var(--line);
  border-radius: 14px; padding: 14px; transition: opacity .15s; }
.gm-game.soon { border-style: dashed; }
.gm-game.dim { opacity: .4; }
.gm-art { height: 92px; display: flex; align-items: flex-end; justify-content: center; background: var(--soft); border-radius: 10px; margin-bottom: 4px; }
.gm-art img { height: 78px; }
.gm-tag { position: absolute; top: 20px; right: 20px; font-size: 11px; font-weight: 800; background: var(--accent); color: var(--accent-text);
  padding: 1px 8px; border-radius: 8px; }
.gm-game.soon .gm-tag { background: var(--muted); color: var(--card); }
.gm-title { font-size: 18px; }
.gm-about { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.4; }
.gm-meta { display: flex; flex-wrap: wrap; gap: 6px; font-size: 13px; }
.gm-meta span { background: var(--soft); border-radius: 999px; padding: 2px 9px; }
/* «Как играть» в ряду на одной линии: верхние блоки .gm-head одной высоты (alignHeads в games.js, владелец
   28 октября 2026); кнопка под ним — сразу следом */
.gm-rules { font-size: 14px; }
.gm-rules + .gm-go, .gm-rules + .gm-link { margin-top: 8px; }
.gm-rules summary { cursor: pointer; color: var(--accent); font-weight: 600; }
.gm-rules ol { margin: 6px 0 0; padding-left: 20px; line-height: 1.4; }
.gm-rules li { display: list-item; border: 0; padding: 0; margin: 0 0 4px; }
.gm-go { width: 100%; margin: 0; text-align: center; box-sizing: border-box; font-weight: 600; }
/* неподтверждённому вместо «Создать комнату»: пояснение и привязка Telegram */
.gm-link { display: grid; gap: 6px; }
.gm-link p { margin: 0; font-size: 13px; }
.gm-link .gm-go { margin: 0; }
.gm-game > .gm-rules { margin-bottom: 6px; }
@media (max-width: 640px) {
  .gm h1 { font-size: 24px; }
  .gm-art { height: 76px; }
  .gm-art img { height: 64px; }
}

/* --- «Тайное слово» на компьютере: все вопросы слева, очередь справа (docs/design/word-left-panel.html, F) --- */
.sw-left { position: absolute; left: 16px; bottom: 16px; z-index: 3; display: flex; flex-direction: column; gap: 8px; min-height: 0;
  padding: 10px 12px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); box-sizing: border-box; }
.sw-left-head { display: flex; align-items: center; gap: 8px; }
.sw-left-head h3 { margin: 0; font-size: 14px; flex: 1; }
/* мельче, чем в ленте справа раньше: в узкую колонку влезает больше вопросов (просьба владельца) */
.sw-left .counters { gap: 4px; }
.sw-left .counters small { font-size: 10px; }
.sw-left .cnt-row { gap: 4px; }
.sw-left .cnt { font-size: 11.5px; gap: 3px; padding: 1px 7px 1px 2px; }
.sw-left .cnt .sign { width: 15px; height: 15px; font-size: 9.5px; }
.sw-left .cnt b { font-size: 12px; }
.sw-left .lvl { font-size: 11px; padding: 1px 7px; gap: 3px; }
.sw-left .questions { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
.sw-left .q { padding: 5px 0; gap: 4px; }
.sw-left .q-line { font-size: 12.5px; gap: 4px; line-height: 1.3; }
.sw-left .q-line .tok { font-size: 11px; padding: 1px 7px; gap: 3px; }
.sw-left .q-wait { font-size: 10.5px; }
.q.queued .q-text, .q.skipped .q-text { color: var(--muted); }
.q-wait { color: var(--muted); font-size: 11.5px; white-space: nowrap; }
.tok.tok-skip { background: transparent; color: var(--muted); border: 1px dashed currentColor; font-weight: 600; }
/* справа очередь постоянной высоты (просьба владельца: от длины вопроса прыгали очередь и чат под ней).
   Высоты хватает Главе на вопрос в 200 знаков, жетоны и «Пропустить»; «Дальше» внизу обрезается, если не влез */
body.in-game .side .feed.sw-queue { flex: none; height: 380px; max-height: 58%; }
/* боковые отступы — под наклонённую бумажку: без них её угол обрезался краем блока */
.feed.sw-queue .questions { display: flex; flex-direction: column; gap: 10px; padding: 10px 6px 4px; overflow: hidden; -webkit-mask-image: none; mask-image: none; }
.feed.sw-queue .questions > * { flex: none; }
.sw-next[hidden], .sw-next .nx[hidden], .sw-next .more[hidden] { display: none; }
.sw-qn { background: var(--accent); color: var(--accent-text); border-radius: 999px; padding: 1px 10px; font-size: 12px; font-weight: 700; }
.sw-now { transform: rotate(-.8deg); box-shadow: 0 2px 6px rgba(0, 0, 0, .25); }
.sw-now.shown { outline: 3px solid var(--oc, #2E8B57); outline-offset: 0; }
.sw-now.shown-yes { --oc: #2E8B57; } .sw-now.shown-no { --oc: #C0392B; } .sw-now.shown-maybe { --oc: #2F6FC0; }
.sw-now.shown-so_close { --oc: #B7C925; } .sw-now.shown-way_off { --oc: #7A2230; } .sw-now.shown-correct { --oc: #E2B23A; }
.sw-now.shown-skip { outline: 2px dashed var(--muted); }
.sw-verdict { display: flex; justify-content: center; }
.sw-verdict .tok { font-size: 16px; padding: 5px 16px; }
.sw-wait, .sw-place { margin: 0; text-align: center; font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.sw-place { color: var(--accent); font-weight: 600; }
.sw-q-toks { justify-content: center; }
.sw-skip { justify-self: center; margin: 0; padding: 2px 6px; background: none; border: 0; color: var(--muted); font-size: 13px; font-weight: 500; text-decoration: underline; }
.sw-skip:hover:not(:disabled) { color: var(--text); }
/* «Дальше»: строка на вопрос, длинный — многоточием; под заголовком линия, как у шапки блока */
.sw-next { display: grid; gap: 0; font-size: 13px; color: var(--muted); }
.sw-next small { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; padding-bottom: 4px; }
.sw-next .nx { display: flex; gap: 6px; min-width: 0; padding: 4px 0; border-top: 1px solid var(--line); }
.sw-next .nx b { flex: none; }
.sw-next .nx span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sw-next .nx.mine { color: var(--accent); }
.sw-next .more { padding-top: 4px; font-size: 12px; }
/* пустая очередь — посередине блока */
.sw-empty { display: grid; gap: 12px; margin: auto 0; text-align: center; }
.sw-empty-t { margin: 0; font-size: 14px; color: var(--muted); }
.sw-empty .ask-soft { justify-content: center; }
.sw-last { display: grid; gap: 4px; text-align: left; }
.sw-last small { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.sw-last-q { display: flex; align-items: center; gap: 8px; width: 100%; margin: 0; padding: 8px 10px; border-radius: 10px; border: 1px solid transparent;
  background: var(--soft); color: var(--text); font-size: 13.5px; font-weight: 400; text-align: left; cursor: pointer; }
.sw-last-q:hover { border-color: var(--accent); }
.sw-next .nx { cursor: pointer; }
.sw-next .nx:hover span { color: var(--text); }
.sw-last-q > span:first-child { flex: 1; min-width: 0; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sw-last-q .tok { flex: none; white-space: nowrap; }
/* окно вопроса у Главы на телефоне: «Пропустить» и «Позже» рядом под чертой */
.sw-q-foot-btns { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.sw-now .fc-q-text { margin: 0; }
.feed.sw-queue .feed-head { flex-wrap: nowrap; align-items: center; }
.feed.sw-queue .feed-title { width: auto; }
/* длинный вопрос в истории — три строки, целиком по нажатию в окне вопроса */
.sw-left .q-line .q-text { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
/* правило про вопросы вслух у Главы — внизу очереди (над столом осталась только «Ждут ответа N») */
.feed.sw-queue .sw-aloud { margin: auto 0 0; padding-top: 6px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); text-align: center; }
/* с колонкой «Все вопросы» кнопки стола столбиком у правого края (идея владельца): верхний ряд свободен
   для подсказки над Главой; «Пауза» — значком, подпись в подсказке при наведении */
.table-card.sw-cols .corner.tr { flex-direction: column; gap: 6px; }
.table-card.sw-cols #g-pause { padding: 5px 9px; }
.table-card.sw-cols #g-pause .lbl { display: none; }
/* просьба о паузе посреди стола на компьютере: карточка поверх столешницы, шире центра при нужде */
.stage .center.with-vote { width: auto !important; min-width: 260px; max-width: 360px; }
.stage .center.with-vote .pause-vote { text-align: left; color: var(--text); box-shadow: 0 6px 20px rgba(0, 0, 0, .35); background: var(--card); }
.stage .center.with-vote .pause-vote { gap: 6px; padding: 8px 10px; }
.stage .center.with-vote .pause-vote .play-head b { font-size: 14px; }
.stage .center.with-vote .pause-vote .pick { padding: 6px 10px; font-size: 14px; }
.stage .center.with-vote .pause-vote .muted { font-size: 12px; margin: 0; }
/* загаданное слово в окнах голосования и поиска — маркером в строке, а не просто жирным */
.word-mark { background: #FFE08A; color: #2A211A; font-weight: 800; padding: 1px 7px; border-radius: 5px;
             -webkit-box-decoration-break: clone; box-decoration-break: clone; }
/* флажок «выбрал» над карточкой того, на кого указал Полукровка (вариант D из docs/design/hunt-pick.html):
   поверх края карточки, высоту ряда не меняет; угадал — золотой */
.res-card { position: relative; }
.res-pick { position: absolute; top: -11px; left: 50%; transform: translateX(-50%); z-index: 1; display: inline-flex; align-items: center; gap: 3px;
            padding: 2px 8px 2px 3px; border-radius: 999px; background: #C0392B; color: #fff; font-size: 11px; font-weight: 800; white-space: nowrap;
            box-shadow: 0 2px 6px rgba(0,0,0,.25); }
.res-pick i { width: 17px; height: 17px; border-radius: 50%; background: #F3E3D8 url(/assets/seat_werewolf.png) no-repeat 50% 10% / 165%; }
.res-pick.found { background: #D9A82E; color: #3A2A00; }
/* зрители в шапке чата: «👀 N», имена всплывают при наведении или нажатии (на телефоне — нажатием) */
.watchers { position: relative; display: inline-flex; align-items: center; gap: 2px; padding: 1px 8px; border-radius: 999px; background: var(--soft);
            color: var(--muted); font-size: 13px; cursor: default; white-space: nowrap; }
.watchers b { color: var(--text); }
.watchers-tip { display: none; position: absolute; top: calc(100% + 6px); left: 0; z-index: 5; width: max-content; max-width: 240px; white-space: normal;
                padding: 6px 10px; border-radius: 8px; background: var(--card); color: var(--text); border: 1px solid var(--line);
                box-shadow: 0 6px 16px rgba(0,0,0,.15); font-size: 13px; }
.watchers:hover .watchers-tip, .watchers:focus .watchers-tip { display: block; }
/* «Время вышло. Играем ещё 5 минут?» в «Карточке на лбу»: «Да», «Нет», «Я сдаюсь» в ряд, последняя тише */
.pause-vote .more-picks { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.pause-vote .more-picks.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pause-vote .more-picks .pick.give-up { color: var(--muted); }
/* слово сдавшегося: открыто, но без галочки «угадал» */
.w-note.guessed.gave-up { background: var(--soft); color: var(--text); }
.w-note.guessed.gave-up::before { content: none; }
.fc-place.gave-up { background: var(--soft); color: var(--muted); }
/* окно «Вы пишете слово»: таймер справа, рядом с крестиком */
.fc-write-dialog .modal-head h2 { flex: 1; }
/* Голосование окном (docs/design/vote-modal.html, B): полоса времени по верху, ответы плитками со значками */
dialog.ballot-dialog { overflow: hidden; width: min(400px, calc(100vw - 32px)); }
.ballot-bar { height: 6px; background: var(--soft); }
.ballot-bar i { display: block; height: 100%; background: var(--accent); animation: ballot-drain linear forwards; }
@keyframes ballot-drain { to { width: 0; } }
.ballot-body { padding: 16px 18px 12px; }
.ballot-head { display: flex; align-items: flex-start; gap: 10px; }
.ballot-head h2 { flex: 1; margin: 0; font-size: 19px; line-height: 1.25; }
.ballot-by { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.ballot-tiles { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 8px; margin: 14px 0 10px; }
.ballot-tile { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 4px 10px; border: 1.5px solid var(--line); border-radius: 10px;
             background: var(--card); color: var(--text); font-weight: 700; font-size: 14px; white-space: nowrap; }
.ballot-tile:hover { border-color: var(--accent); }
.ballot-tile.chosen { border-color: var(--accent); background: var(--soft); color: var(--accent); }
.ballot-tile.quiet { color: var(--muted); font-weight: 600; }
.ballot-icon { font-size: 24px; line-height: 1; height: 26px; }
.ballot-tile.chosen .ballot-icon { font-weight: 800; }
.ballot-wait { margin: 12px 0 6px; font-weight: 700; color: var(--accent); }
.ballot-count { margin: 0 0 4px; font-size: 14px; font-weight: 600; }
.ballot-note { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.4; }
.ballot-fold { display: block; margin: 16px 0 0 auto; }
.ballot-head .timer { background: var(--soft); border-radius: 8px; padding: 3px 8px; }
/* свёрнутое окно — блок над столом: нажал — окно снова */
.pause-vote { cursor: pointer; }
@media (max-width: 400px) {
  .ballot-body { padding: 14px 14px 10px; }
  .ballot-head h2 { font-size: 17px; }
  .ballot-tile { font-size: 13px; padding: 10px 2px 8px; }
}
/* свёрнутое голосование на телефоне — плашка над кнопками «Вопросы» и «Чат»; на компьютере — блок у стола */
.ballot-pill { display: none; }
@media (max-width: 760px) {
  .ballot-pill:not([hidden]) { display: flex; position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%); z-index: 30; align-items: center; gap: 8px;
    padding: 9px 14px; border-radius: 999px; border: 2px solid var(--accent); background: var(--card); color: var(--text); font-weight: 700; font-size: 14px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .25); white-space: nowrap; }
  .ballot-pill b { color: var(--accent); }
}
/* подсказка горячей клавиши на кнопке «Задать вопрос Главе»: на телефоне клавиатуры нет */
.ask-soft .hotkey { margin-left: 8px; font: 700 11px ui-monospace, Consolas, monospace; padding: 1px 6px; border-radius: 5px; border: 1px solid currentColor;
  opacity: .6; }
@media (max-width: 760px) { .ask-soft .hotkey { display: none; } }
/* «Отмена» вопроса голосом (docs/design/voice-cancel.html): на компьютере под подписью во всю её ширину,
   на телефоне — внутри поля справа, панель остаётся в одну строку */
.w-note-box { display: grid; gap: 6px; width: 100%; }
.w-note-box input { width: 100%; }
button.plain.w-cancel { background: var(--card); color: var(--error); border: 1.5px solid var(--error); font-weight: 700; }
button.plain.w-cancel:hover { background: var(--soft); }
.w-note-box.in-field { position: relative; display: block; }
.w-note-box.in-field input { padding-right: 92px; }
.w-note-box.in-field .w-cancel { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); padding: 4px 14px; font-size: 14px; border-radius: 8px; }

/* --- настройки: галочки и текст (темы и своя тема «Самозванца») --------------------------------- */
.settings-grid .checks { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; margin-bottom: 4px; }
.checks label { display: grid; grid-template-columns: 20px 1fr; gap: 0 6px; align-items: start; margin: 0; padding: 7px 10px; border-radius: 10px;
  border: 2px solid var(--line); cursor: pointer; font-size: 12px; line-height: 1.3; color: var(--muted); }
.checks label b { font-size: 14px; color: var(--text); }
.checks label span { grid-column: 2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.checks label.on { border-color: var(--accent); background: var(--soft); }
.checks input { margin: 2px 0 0; grid-row: span 2; }
.settings-grid input[data-text], .settings-grid textarea[data-text] { grid-column: 1 / -1; width: 100%; box-sizing: border-box; }
.settings-grid textarea[data-text] { resize: vertical; font: inherit; }
.settings-grid > [hidden] { display: none; }
@media (max-width: 560px) { .settings-grid .checks { grid-template-columns: 1fr; } }

/* --- «Самозванец» за столом (docs/design/impostor.html, D; static/impostor.js) ------------------- */
/* своя карточка: слово и тема; у шпиона тёмная, с оливкой в плаще */
.g-role.im-card .im-word { font-size: 21px; color: var(--text); overflow-wrap: anywhere; }
.g-role.im-card .im-topic { display: block; font-size: 13px; color: var(--muted); margin-top: 1px; }
.g-role.im-card.spy { --rc: #8E7350; background: #24201C; }
.g-role.im-card.spy small, .g-role.im-card.spy .im-topic { color: #C9BFAE; }
.g-role.im-card.spy .im-word { color: #F1ECE2; }
.g-role.im-card.spy .ava { background: #3A3634; }
/* глазок «спрятать карточку» в правом верхнем углу: длинное слово не заезжает под него */
.secret-wrap .g-role.im-card { padding-right: 40px; }
/* на телефоне слово мельче и переносится: длинное («Туалетная бумага») уезжало под глазок */
@media (max-width: 760px) { body.in-game .g-role.im-card .im-word { display: inline; font-size: 17px; } }

/* «Все слова темы» (docs/design/spy-notebook.html, 3): кнопка на карточке и стикеры на пробковой доске.
   .im-cork, а не .im-board: так уже зовётся табличка над столом */
#g-role > .im-words-btn { display: block; width: 100%; margin: 8px 0 0; padding: 7px 12px; font-size: 14px; font-weight: 600; }
#g-action > .im-words-btn { width: 100%; margin: 0 0 4px; padding: 7px 12px; font-size: 14px; font-weight: 600; }
.im-word-lbl { display: none; }
@media (max-width: 760px) { body.in-game .im-word-lbl { display: inline; font-weight: 600; color: var(--muted); } }
dialog.im-words-dialog { width: min(720px, calc(100vw - 32px)); max-height: min(640px, calc(100dvh - 32px)); border: 0; background: transparent; overflow: visible; }
.im-cork { display: grid; grid-template-rows: auto 1fr auto; gap: 10px; max-height: min(640px, calc(100dvh - 32px)); box-sizing: border-box; padding: 14px 16px;
  border-radius: 14px; background: #C9A574; background-image: radial-gradient(rgba(0, 0, 0, .08) 1px, transparent 1.5px), radial-gradient(rgba(255, 255, 255, .12) 1px, transparent 1.5px);
  background-size: 7px 7px, 11px 11px; border: 10px solid #8A5E36; box-shadow: 0 20px 50px rgba(0, 0, 0, .45), inset 0 0 20px rgba(0, 0, 0, .2); color: #2E2A24; }
.words-pane { display: none; }
.im-cork-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; background: #FFFDF6; padding: 8px 12px;
  border-radius: 4px; transform: rotate(-.6deg); box-shadow: 0 3px 6px rgba(0, 0, 0, .2); }
.im-cork-head b { font-size: 18px; color: #3D5A2A; }
.im-cork-head span { font-size: 13px; color: #6B5E4A; }
/* поиск по доске: совпадения — жёлтым маркером, остальное бледнеет */
input.im-search { flex: 1 1 100%; margin: 4px 0 0; padding: 6px 10px; font-size: 14px; background: #fff; color: #2E2A24; border: 1px solid #D9CDB4; border-radius: 6px; }
input.im-search::placeholder { color: #9A8E7A; }
.im-wd.hit { background: #FFE066; box-shadow: 0 0 0 2px #FFE066; }
.im-wd.miss { opacity: .3; }
.im-note.miss { opacity: .35; }
.im-guess-search { margin: 8px 16px 0; }
.im-guess-search input.im-search { margin: 0; border-color: var(--line); }
.im-notes-wrap { overflow: auto; min-height: 0; min-width: 0; }
.im-cork { position: relative; }
/* ниже есть ещё: низ растворяется, над ним плашка «↓ ещё слова» */
.im-notes-wrap.more { -webkit-mask-image: linear-gradient(to bottom, #000 78%, transparent); mask-image: linear-gradient(to bottom, #000 78%, transparent); }
.im-more { position: absolute; left: 50%; bottom: 52px; transform: translateX(-50%); margin: 0; padding: 5px 14px; border-radius: 999px; font-size: 13px; font-weight: 700;
  background: #3D5A2A; color: #FFFDF6; box-shadow: 0 3px 8px rgba(0, 0, 0, .3); z-index: 2; }
.im-more[hidden] { display: none; }
dialog.im-guess-dialog .im-more { bottom: 14px; }
/* окно фокусирует список при открытии: рамка фокуса вокруг доски не нужна */
.im-notes-wrap:focus { outline: none; }
/* стикер по своему содержимому, а не по самому длинному в ряду: короткий растягивался пустым (владелец) */
.im-notes { display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-start; gap: 14px; align-content: start; padding: 6px 4px 10px; }

/* шрифт слов — как в тетради, «синей ручкой» (выбор владельца) */
.im-note { width: 196px; padding: 18px 10px 10px; font: italic 15.5px/1.6 Georgia, "Times New Roman", serif; color: #2E2A24; position: relative;
  box-shadow: 0 6px 10px rgba(0, 0, 0, .22); box-sizing: border-box; }
.im-note::before { content: ""; position: absolute; left: 50%; top: 5px; width: 12px; height: 12px; margin-left: -6px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #FF8A80, #C0392B 70%); box-shadow: 0 2px 2px rgba(0, 0, 0, .35); }
.im-note:nth-child(5n+1) { background: #FFF3A6; transform: rotate(-2deg); } .im-note:nth-child(5n+2) { background: #C8F0C2; transform: rotate(1.5deg); }
.im-note:nth-child(5n+3) { background: #FFD3E0; transform: rotate(-1deg); } .im-note:nth-child(5n+4) { background: #CFE6FF; transform: rotate(2deg); }
.im-note:nth-child(5n) { background: #FFE0B8; transform: rotate(-1.5deg); }
.im-note.done { opacity: .55; }
/* слово — строчный текст: переносится как в абзаце, подсветка и зачёркивание идут по всем его строкам */
.im-wd { white-space: nowrap; padding: 0 1px; cursor: pointer; border-radius: 3px; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.im-wd.long { white-space: normal; }
.im-wd:hover { background: rgba(0, 0, 0, .07); }
.im-wd:focus-visible { outline: 2px solid #3D5A2A; outline-offset: 1px; }
.im-wd.x { opacity: .5; text-decoration: line-through; text-decoration-thickness: 2px; text-decoration-color: #222; }
/* своё слово: красная волнистая черта снизу, как пометка ручкой */
.im-wd.own { text-decoration: underline wavy #C0392B; text-decoration-thickness: 2px; text-underline-offset: 4px; }
.im-wd.own.x { text-decoration: line-through; text-decoration-color: #222; }
.im-wd.picked { opacity: 1; background: #B3261E; color: #fff; padding: 0 4px; text-decoration: none; }
.im-cork-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; color: #3A2A14; font-size: 13px; font-weight: 600; }
.im-cork-foot button { margin: 0; }

/* последний шанс: всё красное, «Вас вскрыли!» (docs/design/spy-words.html) */
dialog.im-guess-dialog { width: min(740px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); padding: 0; border: 3px solid #B3261E; overflow: hidden;
  display: grid; grid-template-rows: auto auto auto 1fr auto; background: var(--card); }
dialog.im-guess-dialog:not([open]) { display: none; }
dialog.im-guess-dialog::backdrop { background: rgba(70, 8, 8, .6); }
.im-guess-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; background: #B3261E; color: #fff; }
.im-guess-head b { font-size: 22px; font-weight: 900; }
.im-guess-clock { font: 900 22px/1 system-ui, sans-serif; background: rgba(255, 255, 255, .18); color: inherit; padding: 6px 12px; border-radius: 10px; font-variant-numeric: tabular-nums; }
.im-guess-lead { margin: 10px 16px 0; font-size: 14.5px; font-weight: 600; }
dialog.im-guess-dialog .im-cork { margin: 10px 12px 0; max-height: none; min-height: 0; grid-template-rows: 1fr; border-width: 6px; box-shadow: none; }
.im-guess-foot { padding: 10px 16px 14px; }
.im-guess-go { width: 100%; margin: 0; background: #B3261E; color: #fff; font-weight: 800; }
dialog.im-guess-wait-dialog { width: min(380px, calc(100vw - 32px)); padding: 22px 20px; text-align: center; border: 3px solid #B3261E; }
dialog.im-guess-wait-dialog::backdrop { background: rgba(70, 8, 8, .5); }
.im-guess-fig { height: 90px; display: block; margin: 0 auto 6px; }
.im-guess-who { display: block; font-size: 20px; color: #B3261E; }
dialog.im-guess-wait-dialog p { margin: 6px 0 12px; color: var(--muted); font-size: 14px; }
dialog.im-guess-wait-dialog .im-guess-clock { display: inline-block; background: var(--soft); color: var(--text); }

@media (max-width: 760px) {
  /* телефон: доска во весь экран, сверху заметное «‹ К столу» */
  dialog.im-words-dialog { width: 100%; max-width: none; height: 100dvh; max-height: 100dvh; margin: 0; inset: 0; }
  dialog.im-words-dialog .im-cork { width: 100%; height: 100dvh; max-height: none; border-radius: 0; border-width: 6px; grid-template-rows: auto auto 1fr auto; padding: 10px; }
  .im-notes { gap: 10px; justify-content: center; }
  .im-note { width: calc(50% - 8px); font-size: 14.5px; }
  .im-cork-foot span { min-width: 0; }
  dialog.im-guess-dialog { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; border-radius: 0; }
}
/* лента «Намёки» колонкой под карточкой */
.w-learned.im-feed { display: flex; flex-direction: column; overflow: hidden; max-height: none; }
.im-feed h3 { margin: 0 0 6px; font-size: 14px; }
.im-feed .fc-filter { margin-bottom: 6px; }
/* шрифт как в левой колонке «Тайного слова» (владелец): в узкую колонку влезает больше */
.im-list { overflow-y: auto; flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; padding-right: 2px; }
.im-circ { font-size: 10.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; border-top: 1px solid var(--line); padding-top: 6px; }
.im-item { line-height: 1.3; overflow-wrap: anywhere; }
.im-item.silent { color: var(--muted); font-style: italic; }
.im-item.trial { background: var(--soft); border-radius: 8px; padding: 4px 7px; font-size: 12px; }
.im-item.trial.revealed { box-shadow: inset 3px 0 0 #C0392B; }
/* номинации подряд не сливаются в одну плашку (владелец): отступ между ними и от намёков, в том числе в ленте на телефоне */
.im-item.trial { margin-top: 4px; }
.im-item.trial + .im-item.trial { margin-top: 8px; }
.im-item .im-who { display: block; font-size: 10.5px; color: var(--muted); }
.im-chips { display: flex; flex-wrap: wrap; gap: 3px; align-items: center; margin-top: 2px; }
.im-list .ia.sm { font-size: 10.5px; line-height: 16px; }
.im-list .im-who-voted { width: 19px; height: 19px; }
/* стрелка-галочка: развернуть, кто что ответил (владелец: «минималистичнее, особенно на телефоне») */
.im-who-voted { position: relative; width: 22px; height: 22px; padding: 0; border: 0; border-radius: 50%; background: var(--soft); cursor: pointer; flex: none; }
.im-who-voted::before { content: ""; position: absolute; left: 50%; top: 45%; width: 6px; height: 6px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
  transform: translate(-50%, -50%) rotate(45deg); transition: transform .15s; }
.im-who-voted.open::before { transform: translate(-50%, -20%) rotate(-135deg); }
.im-who-voted:hover { background: var(--line); }
.im-votes { margin-top: 3px; font-size: 11.5px; color: var(--muted); background: var(--soft); border-radius: 8px; padding: 5px 8px; line-height: 1.5; }
.im-votes b { color: var(--text); font-weight: 600; }
/* строка итога номинации со стрелкой «Кто как голосовал» справа от текста */
.im-trial-line { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
/* «Круг 1 2 …»: листает ленту к кругу; 10 цифр помещаются в колонку */
.im-circles { display: flex; gap: 1px; align-items: center; overflow-x: auto; scrollbar-width: none; margin: 0 0 6px; padding: 1px; }
.im-circles::-webkit-scrollbar { display: none; }
.im-circles span { font-size: 12px; color: var(--muted); margin-right: 3px; flex: none; }
.im-circles button { flex: none; width: 19px; height: 26px; padding: 0; border: 0; border-radius: 7px; background: transparent; color: var(--text);
  font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.im-circles button:hover { background: var(--soft); }
.im-circles button.now { color: var(--accent); box-shadow: inset 0 -2px 0 var(--accent); border-radius: 0; }
.im-circles button.im-all { width: auto; padding: 0 7px; margin-right: 3px; }
.im-circles button.on, .im-circles button.on.now { background: var(--accent); color: var(--accent-text); box-shadow: none; border-radius: 7px; }
.im-feed-tools { display: grid; gap: 4px; }
.im-feed-tools .im-circles button { width: 28px; height: 30px; font-size: 14px; }
/* «Все» по ширине текста и на телефоне: в кнопке 28px буквы вылезали за подсветку (владелец) */
.im-feed-tools .im-circles button.im-all { width: auto; padding: 0 10px; }
/* справа короткие правила: панель по содержимому, чат ниже забирает остальное (владелец: «слишком большой») */
body.in-game.im-game .side .feed { flex: 0 0 auto; }
body.in-game.im-game .side .feed .questions { overflow: visible; flex: none; }
.im-howto { display: grid; gap: 9px; padding: 4px 0 2px; font-size: 13.5px; line-height: 1.4; }
.im-step { display: grid; grid-template-columns: 22px 1fr; gap: 9px; align-items: start; }
.im-n { width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: var(--accent-text); display: grid; place-items: center;
  font-size: 12px; font-weight: 800; }
.im-step b { font-weight: 700; }
.im-step .ia { color: #fff; vertical-align: 1px; }
.im-more { justify-self: start; margin-top: 2px; }
/* ответы: «Да», «Нет», «Не сказал бы», «Не ответил» — плашки и кнопки */
.ia { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 10px; font-size: 12.5px; font-weight: 700; color: #fff;
  background: #7A8794; white-space: nowrap; line-height: 1.35; }
.ia.sm { font-size: 11px; padding: 0 6px; line-height: 17px; }
.ia-yes { background: #2E8B57; } .ia-no { background: #C0392B; } .ia-unsure { background: #A07A1E; } .ia-none { background: #8C96A1; }
.ia-done { background: var(--accent); }
.g-seat .tg .ia { color: #fff; }
.g-seat .tg .ia-yes { background: #2E8B57; } .g-seat .tg .ia-no { background: #C0392B; } .g-seat .tg .ia-unsure { background: #A07A1E; }
.g-seat .tg .ia-none { background: #8C96A1; } .g-seat .tg .ia-done { background: var(--accent); }
.im-round { white-space: nowrap; }
.g-seat .tg .im-spy-tag { background: #24201C; color: #F1ECE2; }
.im-answers { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
.ia-btn { padding: 8px 14px; border-radius: 10px; font-weight: 700; color: #fff; border: 0; }
.ia-btn.ia-yes { background: #2E8B57; } .ia-btn.ia-no { background: #C0392B; } .ia-btn.ia-unsure { background: #A07A1E; }
.ia-btn.picked { outline: 3px solid #F3EBDD; outline-offset: 2px; }
/* над столом: круг */
.im-round { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 10px; border-radius: 999px; background: var(--soft); color: var(--text); margin-bottom: 2px; }
.im-round.last { background: #C0392B; color: #fff; }
/* центр стола: намёк, пауза на номинации, итог */
.stage .im-take { max-width: 100%; overflow-wrap: anywhere; }
/* намёк на столе и прошлый намёк — кнопки: открывают окно с намёком целиком */
.stage button.im-last { background: none; border: 0; padding: 0; font: inherit; color: #F1E6DA; font-size: 13px; cursor: pointer; }
.stage button.im-last:hover { text-decoration: underline; text-underline-offset: 3px; }
.im-hint-dialog .im-answers { flex-wrap: nowrap; }
.im-hint-dialog .ia-btn { flex: 1; padding: 11px 2px; font-size: 14px; white-space: nowrap; }
.im-hint-dialog .ia-btn.picked { outline-color: var(--text); }
.im-hint-dialog .im-hint-wait, .im-hint-dialog .im-tally { justify-content: flex-start; color: var(--muted); padding-top: 12px; border-top: 1px solid var(--line); }
.im-hint-dialog .w-clock { background: var(--soft); color: var(--text); }
.im-wait { color: #F1E6DA; font-size: 13px; display: flex; gap: 6px; align-items: center; justify-content: center; }
.im-wait .w-clock { font: 700 12px/1 ui-monospace, monospace; background: rgba(0, 0, 0, .45); color: #fff; border-radius: 8px; padding: 3px 8px; }
.im-wait .w-clock.hurry { color: #FFB4A8; }
.im-tally { display: flex; gap: 4px; flex-wrap: wrap; justify-content: center; }
.im-last { color: #F1E6DA; font-size: 13px; text-align: center; overflow-wrap: anywhere; max-width: 100%;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden; }
.stage .im-last-card { position: relative; z-index: 3; display: grid; gap: 3px; justify-items: center; max-width: 100%; box-sizing: border-box;
  padding: 6px 12px 8px; border-radius: 12px; background: rgba(23, 33, 43, .88); border: 1.5px solid rgba(241, 230, 218, .5); }
.stage .im-last-card .im-tally { margin-top: 2px; }
.stage .im-last-who { max-width: 80%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.im-board { background: #17212B; color: #E6EDF5; border: 2px solid #F1E6DA; border-radius: 12px; padding: 6px 14px; text-align: center; }
.im-board small { display: block; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: #C9B8A6; }
.im-board b { font-size: 17px; }
.im-board.last { border-color: #F1B8B2; }
.im-board-foot { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 6px; padding-top: 6px;
  border-top: 1px solid rgba(241, 230, 218, .25); font-size: 12.5px; color: #C9B8A6; white-space: nowrap; }
.im-board-foot .w-clock { font: 700 12px/1 ui-monospace, monospace; background: rgba(255, 255, 255, .12); color: #fff; border-radius: 8px; padding: 3px 8px; }
.im-board-foot .w-clock.hurry { color: #FFB4A8; }
.im-nom { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.im-nominate { background: #C0392B; color: #fff; border: 0; border-radius: 10px; padding: 8px 14px; font-weight: 700; }
.im-go { background: var(--card); color: var(--text); border: 0; border-radius: 10px; padding: 8px 14px; font-weight: 700; }
.im-go.chosen { opacity: .75; }
.stage .im-final { font-size: 13px; line-height: 1.4; }
/* облачко над игроком: его последний намёк */
.im-bubble { position: relative; z-index: 2; display: inline-block; margin-bottom: 6px; padding: 4px 8px; max-width: 140px; background: var(--card); color: var(--text);
  border: 1.5px solid var(--line); border-radius: 12px; font-size: 12.5px; line-height: 1.25; text-align: center; overflow-wrap: anywhere;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .15); }
.im-bubble::after { content: ""; position: absolute; left: 50%; bottom: -7px; transform: translateX(-50%); border: 6px solid transparent; border-top-color: var(--line); border-bottom: 0; }
.im-bubble.long { font-size: 11px; }
.im-bubble-t { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden; }
.im-seat.im-up .im-bubble { position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); width: max-content; }
.im-bubble.silent { color: var(--muted); font-style: italic; }
.im-bubble.now { border-color: var(--accent); color: var(--accent); font-weight: 800; }
/* телефон, 7 игроков и больше: вместо облачка значок 💬, нажал — намёк окном (impostor.js, seatBubble) */
.im-mark { position: relative; z-index: 2; display: inline-flex; align-items: center; justify-content: center; margin: 0 0 2px; padding: 0;
  width: calc(24px / var(--k)); height: calc(24px / var(--k)); font-size: calc(13px / var(--k)); line-height: 1;
  background: var(--card); border: 1px solid var(--line); border-radius: 50%; box-shadow: 0 1px 3px rgba(0, 0, 0, .15); cursor: pointer; }
.im-mark.silent { cursor: default; opacity: .7; }
.im-seat.im-up .im-mark { position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); }
.im-seat.im-accused .pic .fig { filter: drop-shadow(0 0 6px rgba(192, 57, 43, .9)); }
.im-seat.im-revealed .pic::before { content: ""; position: absolute; left: 50%; bottom: -8%; width: 150%; height: 40%; transform: translateX(-50%);
  border-radius: 50%; background: radial-gradient(closest-side, rgba(192, 57, 43, .55), transparent); }
.im-spy-tag { display: inline-block; font-size: 11px; font-weight: 800; color: #F1ECE2; background: #24201C; border-radius: 6px; padding: 0 7px; line-height: 17px; }
/* окно «Кого номинировать?»: крупные фигурки, имена целиком (владелец: «криво и мелко») */
dialog.im-pick-dialog { width: min(620px, calc(100vw - 24px)); }
.im-pick-lead { margin: 0 0 4px; }
/* таймер у крестика, а не посреди шапки */
.im-pick-dialog .modal-head .timer { margin-left: auto; margin-right: 10px; }
.im-picks { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 12px; margin: 12px 0 14px; }
.im-pk { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 8px 10px; border: 2px solid var(--line); border-radius: 16px;
  background: var(--soft); color: var(--text); cursor: pointer; font: inherit; transition: border-color .15s, transform .15s; }
.im-pk:hover:not(:disabled), .im-pk:focus-visible { border-color: #C0392B; transform: translateY(-2px); }
.im-pk-fig { height: 104px; display: flex; align-items: flex-end; }
.im-pk-fig img { height: 104px; }
.im-pk b { font-size: 15px; line-height: 1.2; text-align: center; overflow-wrap: anywhere; }
.im-pk small { font-size: 12px; color: var(--muted); }
/* «Оставили в игре» не переносится: в узкой плитке (7+ игроков) иначе она одна выше соседних (владелец, 28 октября 2026) */
.im-pk small { display: block; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.im-pk:disabled { opacity: .45; cursor: default; }
.im-pick-cancel { width: 100%; }
/* имя в плитке целиком: ник сайта по умолчанию обрезается многоточием, здесь переносится */
.im-pk .nk { display: inline; }
.im-pk .nk-t { white-space: normal; overflow: visible; overflow-wrap: anywhere; }
.im-picks.many { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; margin: 10px 0 12px; }
.im-picks.many .im-pk { padding: 8px 4px 6px; gap: 2px; border-radius: 12px; }
.im-picks.many .im-pk-fig, .im-picks.many .im-pk-fig img { height: 72px; }
.im-picks.many .im-pk b { font-size: 13.5px; }
.im-picks.many .im-pk small { font-size: 11px; }
/* итог */
/* тема, слово и ответ шпиона строками; маркер не рвётся посередине слова (impostor-final-word.html, вариант 5) */
.im-res-word { margin: 0 0 10px; font-size: 15px; line-height: 1.7; }
.im-res-word .word-mark { white-space: nowrap; }
.im-res-word .word-mark.im-miss { color: #C0392B; }
.im-res-topic { font-style: italic; }
.fc-res.im-res .im-res-fig { height: 36px; display: block; }
.fc-res.im-res tr.im-spy-row td { background: var(--soft); }
@media (max-width: 760px) {
  body.in-game .im-seat .im-bubble { font-size: calc(10.5px / var(--k)); width: max-content; max-width: calc(96px / var(--k)); hyphens: manual; padding: calc(2px / var(--k)) calc(6px / var(--k));
    border-radius: calc(10px / var(--k)); margin-bottom: calc(5px / var(--k)); }
  body.in-game .im-seat .im-bubble.long { font-size: calc(9.5px / var(--k)); }
  /* ник уже, чем у «Карточки на лбу»: у крайних мест длинный ник обрезался краем экрана */
  body.in-game .im-seat .nm { max-width: calc(92px / var(--k)); }
  /* 7 игроков и больше: ник уже, крайние места справа и слева не вылезают за край экрана */
  body.in-game .im-stage.crowd .im-seat .nm { max-width: calc(70px / var(--k)); }
  body.in-game .im-seat .tg .ia.sm { font-size: max(10.5px, calc(9px / var(--k))); line-height: 1.4; }
  body.in-game .w-dock .im-answers { flex-wrap: nowrap; }
  body.in-game .w-dock .ia-btn { flex: 1; padding: 11px 0; font-size: 15px; }
  body.in-game .w-dock .ia-btn.picked { outline-color: var(--text); }
  body.in-game .w-dock .im-nom { width: 100%; flex-wrap: nowrap; }
  body.in-game .w-dock .im-nom button { flex: 1; padding: 11px 0; }
  body.in-game .w-dock .im-go { background: var(--soft); }
  .im-picks { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .im-pk-fig, .im-pk-fig img { height: 84px; }
  /* плашка «Партия окончена» своей строкой по центру, «Итоги партии» и «Ещё партию» под ней рядом:
     в сетке на две колонки третья кнопка уезжала влево во второй ряд (владелец) */
  body.in-game #g-action > .im-round { grid-column: 1 / -1; justify-self: center; }
  body.in-game .im-stage .c-clock.small { font-size: 16px; padding: 3px 8px; }
  .im-picks.many { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .im-picks.many .im-pk-fig, .im-picks.many .im-pk-fig img { height: 54px; }
  .im-picks.many .im-pk { min-width: 0; padding: 6px 3px; }
  .im-picks.many .im-pk b { font-size: 12.5px; max-width: 100%; white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere; }
  body.in-game .corner.tc .im-round { justify-self: center; width: auto; }
}

/* --- итоги сезона (season.js; docs/design/season-results.html, B3 с анимацией, владелец 2 ноября 2026) --- */
dialog.season-dialog { width: min(440px, calc(100vw - 32px)); overflow: hidden; text-align: center; border-radius: 16px; }
.sn-top { position: relative; padding: 20px 20px 18px; color: #fff; background: linear-gradient(160deg, #3A6FA8, #24476B); overflow: hidden;
  transition: background .5s; }
.sn-top.closed { background: linear-gradient(160deg, #24476B, #16324F); }
.sn-top.gold { background: linear-gradient(160deg, #E3AE2C, #A8750A); }
.sn-top.silver { background: linear-gradient(160deg, #A9B6C4, #5B6673); }
.sn-top.bronze { background: linear-gradient(160deg, #D08A4E, #8A4E22); }
.sn-top.closed.gold, .sn-top.closed.silver, .sn-top.closed.bronze { background: linear-gradient(160deg, #24476B, #16324F); }
.sn-top > *:not(.sn-rays) { position: relative; }
.sn-top small { display: block; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; opacity: .85; }
.sn-top .sn-title { display: block; font-size: 25px; line-height: 1.15; margin-top: 4px; }
.sn-top .sn-sub { font-size: 14px; opacity: .92; margin-top: 4px; }
.sn-rays { position: absolute; inset: -50%; pointer-events: none; background: repeating-conic-gradient(rgba(255, 255, 255, .14) 0 9deg, transparent 9deg 22deg);
  -webkit-mask: radial-gradient(circle, #000 0 20%, transparent 55%); mask: radial-gradient(circle, #000 0 20%, transparent 55%);
  animation: sn-spin 16s linear infinite; transition: opacity .6s; }
.sn-top.closed .sn-rays { opacity: 0; }
@keyframes sn-spin { to { transform: rotate(360deg); } }
.sn-medal { font-size: 62px; line-height: 1; margin: 6px 0 2px; filter: drop-shadow(0 4px 8px rgba(0, 0, 0, .3)); }
.sn-place { display: inline-grid; place-items: center; width: 62px; height: 62px; margin: 6px 0 2px; border-radius: 50%; font-size: 26px; font-weight: 800;
  background: rgba(255, 255, 255, .16); border: 2px solid rgba(255, 255, 255, .4); }
.sn-mystery { display: inline-grid; place-items: center; width: 66px; height: 66px; margin: 8px 0 4px; border-radius: 50%; font-size: 30px; font-weight: 800;
  background: rgba(255, 255, 255, .12); border: 2px dashed rgba(255, 255, 255, .45); animation: sn-shake 1.6s ease-in-out infinite; }
@keyframes sn-shake { 0%, 70%, 100% { transform: rotate(0); } 76% { transform: rotate(-10deg); } 82% { transform: rotate(9deg); } 88% { transform: rotate(-6deg); } 94% { transform: rotate(4deg); } }
.sn-open { margin-top: 12px; background: #F2C94C; color: #3A2A00; font-weight: 800; font-size: 16px; padding: 11px 26px; }
.sn-hide { visibility: hidden; }
.sn-top .pop { animation: sn-pop .7s cubic-bezier(.3, 1.7, .5, 1) both; }
@keyframes sn-pop { 0% { transform: scale(.2) rotate(-25deg); opacity: 0; } 100% { transform: none; opacity: 1; } }
.sn-top .fade { animation: sn-fade .45s ease-out both; }
@keyframes sn-fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.sn-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sn-nav button { min-width: 32px; padding: 0 8px; font: 22px/28px Georgia, serif; color: #fff; background: rgba(255, 255, 255, .14); border: 0; border-radius: 8px; }
.sn-nav button:disabled { opacity: .3; cursor: default; }
.sn-body { padding: 14px 20px 18px; }
.sn-facts { list-style: none; margin: 0; padding: 0; text-align: left; }
.sn-facts li { display: flex; align-items: center; gap: 12px; padding: 9px 4px; border-bottom: 1px solid var(--line); font-size: 14.5px;
  opacity: 0; transform: translateY(10px); transition: opacity .35s, transform .35s cubic-bezier(.3, 1.5, .5, 1); }
.sn-facts li.in { opacity: 1; transform: none; }
.sn-facts li:last-child { border-bottom: 0; }
.sn-ic { flex: none; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; background: var(--soft); font-size: 18px; }
.sn-ic img { height: 26px; }
.sn-facts b { margin-left: auto; font-size: 16px; white-space: nowrap; }
.sn-hint { margin: 12px 0 0; font-size: 13.5px; color: var(--muted); }
.sn-hint b { color: var(--text); }
.sn-missed { margin-top: 12px; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.sn-missed small { flex-basis: 100%; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.sn-award { padding: 4px 10px; border-radius: 999px; background: var(--soft); font-size: 13px; }
.sn-ok { width: 100%; margin-top: 14px; font-size: 16px; padding: 11px; opacity: 0; transition: opacity .35s; }
.sn-ok.in { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .season-dialog *, .season-dialog *::before { animation: none !important; transition: none !important; } }
/* две кнопки под рейтингом на главной (season-results.html, A2): «Мои награды» в профиль, «Мои итоги» — окно итогов */
.lb-mine-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.lb-mine-btns > * { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 10px; border-radius: 10px; border: 0;
  background: var(--soft); color: var(--text); font: inherit; font-weight: 600; font-size: 14px; text-decoration: none; cursor: pointer; }
.lb-mine-btns > *:hover { background: var(--line); }
