/* Временная вёрстка до настоящего интерфейса: экраны под компьютер, на телефоне не разваливается. */
/* Темы. Цвета подобраны под зелёных человечков из 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=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); }
.seat.fresh .fig { animation: sit .45s cubic-bezier(.3, 1.5, .5, 1); }
@keyframes sit { from { opacity: 0; transform: translate(-50%, -26px); } 60% { opacity: 1; } to { transform: translate(-50%, 0); } }
@media (prefers-reduced-motion: reduce) { .seat.fresh .fig { animation: 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; }
.seat-menu { position: absolute; top: 40px; left: 50%; transform: translateX(-50%); z-index: 5; min-width: 190px; cursor: default;
             background: var(--card); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.18); padding: 6px; }
.seat-menu b { display: block; padding: 4px 10px 6px; font-size: 13px; overflow-wrap: anywhere; }
.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); }
.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-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; 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: 2px 0 0; grid-row: span 2; }
.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; }
/* за столом высоту карточки считает werewords.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; }
.g-watch { position: absolute; left: 16px; bottom: 10px; margin: 0; }
#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 в werewords.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)); }
.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 .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; }
/* окно голосования «Кто Оборотень?»: игроки карточками, имя по центру */
dialog.vote-dialog { width: min(640px, calc(100vw - 32px)); }
/* окно никогда не выше экрана: на низком экране прокручивается */
dialog.vote-dialog { max-height: calc(100vh - 32px); overflow-y: auto; }
/* больше шести карточек: окно шире, карточки ниже, пять в ряд — девять влезают в два ряда */
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); }
.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; }
/* на телефоне 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 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); } }
.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-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: 420px) { .res-btns { grid-template-columns: 1fr; } .result-dialog.many .res-card { width: calc((100% - 2 * 6px) / 3); } }
@media (max-width: 520px) { .vote-grid .vote-card, .vote-dialog.many .vote-grid .vote-card { width: calc((100% - 2 * 8px) / 3); } }
/* окно подтверждения и сообщения вместо стандартных окон браузера (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-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 8px; }
.ask-btns.one { grid-template-columns: 1fr; }
.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; }
/* карточки игр */
/* порядочность в обзоре профиля: число, полоска цвета по порогу, правило строкой */
.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-game.soon { opacity: .6; border: 2px dashed var(--line); }
a.pf-game.soon:hover { opacity: 1; border-color: var(--accent); }
.pf-tg { font-size: 13px; font-weight: 600; 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-dec-pill { 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 { grid-column: 2; justify-self: start; }
}

/* --- стиль ника у 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 { 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 { 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 { background: var(--accent); }
.snd .switch:checked::after { transform: translateX(18px); }
@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; }
}

.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; }
body:not(.room-page):has(.site-foot) main { margin-bottom: 24px; }
body.room-page .site-foot { display: none; }
@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)); }
.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.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 (werewords.js). Компьютер не меняется. */
.phone-only, .side-tabs { 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";
    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; }
  body.in-game #g-stage { grid-area: stage; justify-self: center; margin-top: 0 !important; }
  body.in-game .g-watch { display: none; }
  /* правила, жучок, настройки, выход и «⋯» ведущего — в одном «⋯»; «Пауза» на месте */
  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 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-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; }
