/* Финал и общий чат (V2.19): экран победы и церемонии, сворачиваемый чат, поле ответа в битве (замечание 10).
   Отдельный файл, чтобы app.css не рос; подключается сразу после app.css, до themes.css. */

/* ===== финал: экран победы (27, «Два экрана финала», V2.19) — итоги по центру, без прокрутки с 1366×768 */
.victory { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; min-height: calc(100vh - 240px); text-align: center; }
.brand--victory { width: clamp(90px, 11vw, 120px); margin: 0 auto 4px; }
.brand.brand--victory { max-height: min(18vh, 140px); width: auto; max-width: clamp(90px, 12vw, 160px); object-fit: contain; }
.victory .final__title { font-size: clamp(1.8rem, 4vw, 3rem); margin: 2px 0 4px; }
.victory__mine { font-size: 1.25rem; margin: 0; overflow-wrap: anywhere; }
.awards--victory { display: flex; flex-direction: column; align-items: center; gap: 8px; max-width: 900px; margin-top: 8px; }
.vawards { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.vaward { padding: 4px 10px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: .9rem; white-space: nowrap; }
.vaward--mine { border-color: var(--accent); font-weight: 700; }
.app--victory .stage { max-width: 960px; display: flex; flex-direction: column; padding-bottom: 72px; }  /* место под свёрнутый чат и «ПОЕХАЛИ!» */
.app--victory .stage > .board { flex: 1; display: flex; flex-direction: column; }
.app--victory .board > .victory { flex: 1; min-height: 0; }
.app.app--victory .stage > .hud { display: none; }  /* «Аркада»: пустая полоса HUD над итогами не нужна */
@media (max-height: 640px) { .victory { min-height: 0; } .brand--victory { width: 72px; } }

/* ===== общий чат: свернуть и развернуть (22) — полоса со счётчиком и мягкая пульсация при новых сообщениях */
.chatside__fold { margin-left: auto; }
.chatstrip { position: fixed; right: 16px; bottom: 16px; z-index: 30; display: flex; align-items: center; gap: 10px; padding: 8px 14px;
  border-radius: 12px; background: var(--surface); color: var(--text); border: 1px solid var(--line); box-shadow: var(--shadow); font: inherit; font-weight: 700; cursor: pointer; }
.chatstrip--foot { left: 50%; right: auto; transform: translateX(-50%); bottom: 8px; min-width: min(420px, 60vw); justify-content: space-between; }
.chatstrip__badge { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--bad); color: #fff; font-size: .8rem; display: inline-grid; place-items: center; }
.chatstrip__arrow { opacity: .7; }
.chatpulse { animation: chatpulse 2s ease-in-out infinite; }
@keyframes chatpulse { 0%, 100% { box-shadow: var(--shadow), 0 0 0 0 transparent; } 50% { box-shadow: var(--shadow), 0 0 14px 3px var(--accent); } }
.less-motion .chatpulse { animation: none; box-shadow: var(--shadow), 0 0 0 2px var(--accent); }
@media (prefers-reduced-motion: reduce) { .chatpulse { animation: none; box-shadow: var(--shadow), 0 0 0 2px var(--accent); } }
/* экран победы: развёрнутый чат — панелью поверх нижней части экрана, место справа отдано сцене */
.app--victory .sidecol--foot { display: flex; flex-direction: column; position: fixed; left: 50%; transform: translateX(-50%); bottom: 8px;
  width: min(720px, 92vw); height: 45vh; z-index: 31; padding: 0; }
.app--victory .sidecol--foot .sidecol__answer { display: none; }
.app--victory .sidecol--foot .chatside--docked { flex: 1; min-height: 0; }
.victory--big { min-height: calc(100vh - 200px); }
.victory--big .brand--victory { width: auto; height: clamp(90px, 13vh, 150px); }
.victory--big .final__title { font-size: clamp(2.4rem, 5vw, 4rem); }

/* Замечание 10 (V2.19): поле свободного ответа в битве — не мельче, чем на обычном экране вопроса.
   Тема «Аркада» задаёт всем input 1.1rem и перебивала размер боя; холст боя масштабируется (--bt-s),
   поэтому размер делим на масштаб, чтобы на экране было не меньше 1.1rem. */
.theme-game .bt-q .bt-q__form input, .bt-q__form input { font-size: max(32px, calc(1.1rem / var(--bt-s, 1))); line-height: 1.25; }
.theme-game .bt-panel .bt-q .bt-q__form input, .bt-panel .bt-q__form input { font-size: max(1.1rem, 17px); padding: 13px 14px; }
/* экран победы: подвал занят свёрнутым чатом — строка «© 1986 …» «Аркады» там не показывается;
   открытый чат в подвале непрозрачен, итоги под ним не просвечивают */
.app.app--victory .sidecol--foot .chatside--docked { background: linear-gradient(var(--surface), var(--surface)), var(--bg); }
.theme-game.t-arcade .app--victory .tfoot--arcade, .app--victory .tfoot--arcade { display: none; }
/* свёрнутый чат внизу справа не закрывает конец прокручиваемой страницы (церемония, таблица) */
.app--chatstrip .stage { padding-bottom: 72px; }

/* кнопка «Общий чат» в шапке (22, «Кнопка чата и „Свернуть всё“», V2.22): заметная, с надписью и счётчиком */
.chatbtn { position: relative; white-space: nowrap; }
.chatbtn--on { box-shadow: inset 0 0 0 2px currentColor; }
/* в режиме витрины открывается только чат — поверх сцены */
.app--showcase .chatside--sc { opacity: 1; visibility: visible; pointer-events: auto; z-index: 41; }
.showcase-plaque__chat { position: relative; white-space: nowrap; }
.showcase-plaque__chat .msgbtn__badge { position: absolute; top: -8px; right: -8px; }
.chatside--open.chatside--sc { bottom: 120px; height: min(62vh, calc(100vh - 200px)); }  /* не закрывает плашку и «Развернуть всё» */
