@font-face {
  font-family: "Inter";
  src: url("/fonts/InterVariable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

.host-mobile-bar, .host-panel-backdrop, .mobile-panel-heading, .host-settings, .mobile-assistant, .mobile-host-invite { display: none; }
.players-head { display: none; }

/* Compact controls keep the canvas and game stage as the primary surfaces. */
.icon-button { display: inline-grid; place-items: center; width: 44px; height: 44px; padding: 10px; }
.drawing-actions .erase { background: #a93247; color: #fff; margin-left: auto; }
.effects-control button { width: 40px; height: 40px; padding: 8px; }
.effects-control button[aria-pressed="false"] { opacity: .5; }
.host-library, .pack-chooser, .prompter-feed, .player-canvas { scrollbar-width: thin; scrollbar-color: #77799855 transparent; }
.host-library ::-webkit-scrollbar, .prompter-feed::-webkit-scrollbar, .player-canvas::-webkit-scrollbar { width: 4px; height: 4px; }
.host-library ::-webkit-scrollbar-thumb, .prompter-feed::-webkit-scrollbar-thumb, .player-canvas::-webkit-scrollbar-thumb { background: #77799855; border-radius: 4px; }
.host-library .game-format { display: grid; gap: 8px; }
.host-library .game-format { margin-bottom: 0; }
.host-library .game-format .row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
.host-library .game-format button { padding: 6px 3px; font-size: 12px; }
.host-library .format-final { min-height: 32px; margin: 0; gap: 8px; font-size: 12px; }
.host-library .format-final input { appearance: none; display: grid; place-items: center; border: 1px solid var(--color-muted); border-radius: 5px; background: var(--color-surface); cursor: pointer; }
.host-library .format-final input::after { content: ""; width: 9px; height: 5px; border-bottom: 2px solid var(--color-bg); border-left: 2px solid var(--color-bg); transform: rotate(-45deg) scale(0); transition: transform 120ms ease-out; }
.host-library .format-final input:checked { border-color: var(--color-accent); background: var(--color-accent); }
.host-library .format-final input:checked::after { transform: rotate(-45deg) scale(1); }
.host-library .format-final input:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
.host-library .format-final input:disabled { opacity: .45; cursor: not-allowed; }
.host-library .game-format .note { display: none; }
.host-right .sound-panel:not(.music-player) { display: grid; gap: 8px; padding-bottom: 14px; border-bottom: 1px solid var(--color-surface); }
.host-right .sound-panel .note { font-size: 12px; line-height: 1.4; }
.host-right .sound-panel button { font-size: 12px; padding: 8px; }
.music-meter { height: 24px; display: flex; align-items: center; gap: 3px; color: var(--color-muted); }
.music-meter span { display: block; width: 4px; height: 14px; border-radius: 2px; background: currentColor; }
.music-meter:not(.active) span:last-child { display: none; }
.music-meter.active { color: var(--color-ok); }
.music-meter.active span { animation: music-level .7s ease-in-out infinite alternate; }
.music-meter.active span:nth-child(2) { animation-delay: -.4s; }
.music-meter.active span:nth-child(3) { animation-delay: -.2s; }
@keyframes music-level { from { transform: scaleY(.3); } to { transform: scaleY(1.4); } }
@media (prefers-reduced-motion: reduce) { .music-meter.active span { animation: none; } .music-meter.active span:nth-child(2) { height: 22px; } }

html,
body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
}

* { box-sizing: border-box; }

/* Author display (flex/grid) must not uncover hidden controls. */
[hidden] {
  display: none !important;
}

.shell {
  box-sizing: border-box;
  min-height: 100dvh;
  display: grid;
  align-content: start;
  gap: var(--space-4);
  max-width: var(--content-max);
  margin-inline: auto;
  padding:
    calc(var(--space-5) + env(safe-area-inset-top))
    calc(var(--space-4) + env(safe-area-inset-right))
    calc(var(--space-5) + env(safe-area-inset-bottom))
    calc(var(--space-4) + env(safe-area-inset-left));
}

.slogan,
.note {
  margin: 0;
  color: var(--color-muted);
}

/* Объявление оператора (техперерыв): видно на всех экранах поверх игры. */
.maint-banner {
  margin: 0;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--color-accent);
  color: #221d00;
  font-weight: 700;
  text-align: center;
}

h1 {
  margin: 0;
  font-size: 2rem;
  line-height: 1.1;
}

/* Логотип вместо текстового заголовка: текст остаётся для роботов и скринридеров. */
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.brand-title {
  margin: 0;
  display: flex;
  align-items: center;
}

/* Кнопка звука — в одной строке с логотипом, справа. */
.brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand-row .effects-control {
  flex: none;
  margin: 0;
}

/* Статус соединения — пилюля с подложкой и крутилкой по центру строки с логотипом. */
.brand-status {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 0;
  margin: 0;
  padding: 8px 14px;
  background: var(--color-surface);
  border: 1px solid var(--color-muted);
  border-radius: 999px;
  color: var(--color-text);
  font-size: 14px;
  line-height: 1.3;
  text-align: center;
}

.brand-status .spinner {
  font-size: 16px;
}

/* Длинное слово статуса без пробелов («Подключаемся…») не должно
   распирать шапку на узком экране: разрешается перенос по символам. */
.brand-status > span:last-child {
  min-width: 0;
  overflow-wrap: anywhere;
  hyphens: auto;
}

/* Ошибка — карточка с подложкой, а не голая строка. */
.status-card {
  margin: 0;
  padding: 10px 14px;
  background: var(--color-surface);
  border: 1px solid var(--color-muted);
  border-radius: var(--radius);
}

.status-card.error-card {
  border-color: var(--color-danger);
}

.status-card .alert {
  margin: 0;
}

.status-card a {
  display: inline-block;
  margin-top: 8px;
}

.brand-logo {
  display: block;
  width: auto;
  height: 5rem;
}

.brand-logo.brand-wordmark {
  width: min(10rem, 100%);
  height: auto;
}

.boot-brand {
  display: grid;
  gap: var(--space-3);
  justify-items: center;
  padding-top: clamp(48px, 12dvh, 120px);
  text-align: center;
}

.boot-brand .brand-title { justify-content: center; }

.boot-brand .slogan {
  max-width: 32ch;
  text-wrap: balance;
}

/* Статус загрузки на заглушке: спиннер + текст в одну строку. */
.boot-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: var(--space-3);
}

.boot-spinner {
  flex: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--color-muted);
  border-top-color: var(--color-accent);
  animation: boot-spin 0.9s linear infinite;
}

@keyframes boot-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .boot-spinner {
    animation: none;
    border-top-color: var(--color-muted);
  }
}

/* Ошибка загрузки: скрипт заменяет содержимое #boot текстом и кнопкой. */
#boot .press {
  margin-top: var(--space-2);
}

/* Телевизор: логотип в левом верхнем углу, над списком игроков. */
.tv-brand {
  flex: none;
  display: flex;
  justify-content: center;
}

.tv-brand img {
  display: block;
  width: clamp(48px, 4vw, 84px);
  height: auto;
}

.press {
  min-width: var(--touch-min);
  min-height: var(--touch-min);
  touch-action: manipulation;
}

button,
input {
  font: inherit;
  color: var(--color-text);
}

button {
  background: var(--color-surface);
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: var(--space-2) var(--space-4);
  min-width: var(--touch-min);
  min-height: var(--touch-min);
  touch-action: manipulation;
}

button.primary {
  background: var(--color-accent);
  color: var(--color-bg);
}

button.ok {
  background: var(--color-ok);
  color: var(--color-bg);
}

button.danger {
  background: var(--color-danger);
  color: var(--color-text);
}

button.room-restart {
  background: #6e1218;
  color: #fff8f6;
  border-color: #4a0c10;
}

button.room-restart:hover {
  background: #8c1820;
}

button.room-rethemes {
  background: #7a3d00;
  color: #fff3e2;
  border-color: #552a00;
}

button.room-rethemes:hover {
  background: #96500a;
}

button.pressed {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

button:disabled {
  opacity: 0.45;
}

button:focus-visible,
input:focus-visible,
a:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

input {
  box-sizing: border-box;
  width: 100%;
  min-height: var(--touch-min);
  padding: var(--space-2) var(--space-3);
  background: var(--color-surface);
  border: 1px solid var(--color-muted);
  border-radius: var(--radius);
}

label.grow {
  display: grid;
  gap: var(--space-2);
  flex: 1 1 16rem;
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
}

form {
  display: grid;
  gap: var(--space-3);
}

.keys {
  display: grid;
  gap: var(--space-2);
}

.key-row {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: var(--space-2);
}

.key {
  padding: 0;
}

.key-back {
  grid-column: span 3;
}

.word-preview,
.invite-word {
  min-height: 2.5rem;
  margin: 0;
  font-size: 2rem;
  letter-spacing: 0.08em;
}

.prompt,
.alert {
  margin: 0;
}

.alert {
  color: var(--color-danger);
}

.theme {
  display: grid;
  gap: var(--space-2);
}

.theme h2,
h2 {
  margin: 0;
  font-size: 1.25rem;
}

.cells {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-2);
}

.cell {
  display: grid;
  place-items: center;
  min-height: 4.5rem;
  border-radius: var(--radius);
  background: var(--color-board);
  color: var(--color-text);
  font-size: 1.4rem;
}

.cell.used {
  opacity: 0.35;
}

.question-card {
  position: relative;
  display: grid;
  gap: var(--space-3);
  padding: var(--space-5);
  border-radius: var(--radius);
  background: var(--color-surface);
}

.question-text {
  margin: 0;
  font-size: clamp(1.4rem, 4vw, 2.4rem);
  overflow-wrap: anywhere;
}

/* Read-only answer alternatives: flat text rows, without control affordances. */
.question-with-choices { width: 100%; text-align: left; white-space: normal !important; }
.question-choices-prompt { margin: 0 0 .55em; white-space: pre-wrap; }
.question-choices-prompt[hidden] { display: none; }
.question-choice-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: .3em; list-style: none; margin: 0; padding: 0; }
.question-choice { display: grid; grid-template-columns: 1.35em minmax(0, 1fr); align-items: baseline; gap: .45em; padding: .35em .55em; border-left: 2px solid #ffffff36; border-radius: 4px; background: #ffffff09; color: var(--color-text); line-height: 1.3; font-size: .9em; font-weight: 400; }
.question-choice-label { color: var(--color-accent); font-weight: 600; }
.question-choice-text { min-width: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.question-image-prompt { width: 100%; text-align: left; white-space: pre-wrap; }
.question-choice-media { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); grid-template-rows: minmax(0, 1fr); align-items: center; gap: clamp(10px, 1.5vw, 24px); flex: 1 1 0; width: 100%; min-width: 0; min-height: 0; }
.question-choice-media > .question-images { min-width: 0; min-height: 0; width: 100%; height: 100%; align-self: stretch; }
.question-choice-media .question-image { width: 100%; height: 100%; max-height: 100%; object-fit: contain; }
.question-choice-media .question-with-choices { min-height: 0; }
@media (max-width: 600px) {
  .question-choice-media { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(40px, 1fr) auto; gap: 8px; }
}

.pack-chooser, .game-format { margin-bottom: 24px; }
.pack-chooser h2, .game-format h2 { margin-bottom: 12px; font-size: 24px; }
.sound-panel { margin-bottom: 24px; display: grid; gap: 12px; }
.sound-panel h2 { margin: 0; font-size: 24px; }
.sound-panel .note { margin: 0; }
.sound-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.sound-list .note { list-style: none; }
.sound-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 8px 8px 12px; background: var(--color-surface); border-radius: var(--radius); }
.sound-name { display: flex; align-items: baseline; gap: 8px; min-width: 0; overflow-wrap: anywhere; }
.sound-role { color: var(--color-muted); font-size: 14px; }
.sound-toggle .icon { width: 1.5rem; height: 1.5rem; }
.sound-toggle.sound-off { opacity: 0.45; }
.volume-row { display: grid; gap: 8px; font-size: 16px; }
.volume-row input[type="range"] { width: 100%; accent-color: var(--color-accent); }
.now-playing { margin: 0 0 8px; overflow-wrap: anywhere; }
.pack-choice[aria-pressed="true"] { border-color: var(--color-accent); background: var(--color-board); color: var(--color-accent); }
.format-final { display: flex; align-items: center; gap: 12px; min-height: var(--touch-min); margin-top: 12px; }
.format-final input { flex: 0 0 20px; width: 20px; height: 20px; min-height: 20px; padding: 0; accent-color: var(--color-accent); }
.name-editor { display: grid; gap: 12px; margin: 24px 0; max-width: 960px; }
.drawing-workspace { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-areas: "canvas" "colors" "width" "actions"; gap: 12px; }
.drawing-workspace > .name-canvas { grid-area: canvas; }
.drawing-workspace > .name-colors { grid-area: colors; }
.drawing-workspace > .name-width { grid-area: width; }
.drawing-workspace > .drawing-actions { grid-area: actions; }
.name-editor h3, .name-editor .note { margin: 0; }
.name-canvas { display: block; box-sizing: border-box; width: 100%; height: auto; aspect-ratio: 8 / 3; background: var(--color-surface); border: 1px solid var(--color-muted); border-radius: var(--radius); touch-action: none; user-select: none; cursor: crosshair; }
.name-colors { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 4px; max-width: 440px; }
.name-swatch { display: grid; place-items: center; width: 100%; min-width: 0; min-height: 40px; padding: 3px; background: transparent; border: 2px solid transparent; border-radius: var(--radius); }
.name-swatch span { display: block; width: 100%; max-width: 28px; height: auto; aspect-ratio: 1; border-radius: 50%; background: var(--swatch); }
.name-swatch[aria-pressed="true"] { border-color: var(--color-accent); }
.name-width { display: grid; gap: 8px; }
.name-width-control { display: flex; gap: 12px; align-items: center; }
.name-width-control input { flex: 1; min-width: 0; accent-color: var(--color-accent); }
.name-width-preview { display: grid; place-items: center; width: var(--touch-min); height: var(--touch-min); flex: 0 0 var(--touch-min); border: 1px solid var(--color-muted); border-radius: var(--radius); background: var(--color-surface); }
.name-width-preview span { display: block; border-radius: 50%; }
.drawing-done { display: none; }
.drawn-name { display: inline-block; width: 180px; max-width: 100%; height: auto; aspect-ratio: 8 / 3; vertical-align: middle; }
.face-photo { display: inline-block; width: 72px; height: 72px; border-radius: 50%; object-fit: cover; vertical-align: middle; background: var(--color-surface); }
.prompt .face-photo, .note .face-photo, .prompter-line .face-photo, .holder .face-photo, .tv-phase-note .face-photo { width: 34px; height: 34px; }
.player-frame .face-photo { width: 96px; height: 96px; }
.bubble .face-photo { width: 64px; height: 64px; }
/* Редактор селфи: превью и кадр — тот же круг, что увидят остальные. */
.name-photo { display: grid; gap: 12px; margin: 24px 0; max-width: 960px; }
.name-photo h3, .name-photo .note { margin: 0; }
.photo-stage { display: grid; place-items: center; }
.photo-video, .photo-captured { display: block; width: min(240px, 60vw); height: min(240px, 60vw); border-radius: 50%; object-fit: cover; background: var(--color-surface); border: 1px solid var(--color-muted); }
.photo-actions { justify-content: center; }
.prompt .drawn-name, .note .drawn-name, .prompter-line .drawn-name, .holder .drawn-name, .tv-phase-note .drawn-name { width: 120px; }
.player-frame .drawn-name { width: 100%; max-width: 240px; }
.bubble .drawn-name { width: 144px; }
.question-content { min-height: min-content; display: flex; flex-direction: column; justify-content: safe center; gap: 16px; }
.question-images { min-height: 0; display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 12px; }
.question-image { display: block; max-width: 100%; max-height: 55vh; border-radius: var(--radius-sm); object-fit: contain; }
.question-media { min-height: 0; display: flex; flex-direction: column; align-items: center; gap: 12px; flex-shrink: 0; }
.question-media audio, .question-media video { width: min(100%, 720px); max-height: 55vh; }
.question-media audio { min-height: 54px; flex-shrink: 0; }
.question-card.modifier { animation: modifier-in 700ms ease-out; }
.turn-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; }
.final-judge { display: grid; gap: 8px; }
.final-judge .note { overflow-wrap: anywhere; }
.tv-main .has-media .question-text { font-size: clamp(22px, 2.5vw, 48px); }
.tv-main .question-images { flex: 1; flex-wrap: nowrap; }
.tv-main .question-image { width: 100%; height: 100%; min-width: 0; min-height: 0; max-height: 55vh; }
.player-mode .question-image { max-height: 35vh; }

.price,
.question-meta,
.theme-name,
.holder,
.timer,
.timer-expired,
.timer-wrap,
.answer,
.delta,
.score {
  margin: 0;
}

.question-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5em;
  overflow-wrap: anywhere;
}

.question-meta .price {
  display: inline-flex;
  align-items: center;
  margin: 0;
  padding: 0.12em 0.42em;
  border-radius: var(--radius-sm);
  background: #d7bc64;
  color: #171616;
  font-weight: 700;
  line-height: 1.1;
}

.price,
.score {
  font-variant-numeric: tabular-nums;
}

.timer-wrap {
  position: absolute;
  z-index: 1;
  top: 12px;
  right: 12px;
  display: flex;
  justify-content: center;
}

.timer-expired {
  color: var(--color-muted);
  font-variant-numeric: tabular-nums;
}

/* Кольцо ответа: обводка тает, внутри 00:15–00:00 табличными цифрами. */
.answer-timer {
  --timer-size: 72px;
  position: relative;
  display: inline-grid;
  place-items: center;
  width: var(--timer-size);
  height: var(--timer-size);
}

.answer-timer svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.answer-timer .ring-track,
.answer-timer .ring-fill {
  fill: none;
  stroke-width: 4;
}

.answer-timer .ring-track {
  stroke: color-mix(in srgb, var(--color-text), transparent 70%);
  opacity: 0.35;
}

.answer-timer .ring-fill {
  stroke: var(--color-accent);
  stroke-linecap: round;
  transition: stroke-dashoffset 100ms linear;
}

.answer-timer.urgent .ring-fill {
  stroke: var(--color-danger);
}

.answer-timer .timer-digits {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
  font-weight: 600;
  letter-spacing: 0.02em;
  font-size: calc(var(--timer-size) * 0.24);
  white-space: nowrap;
}

.score {
  font-size: 2.5rem;
}

.answer {
  color: var(--color-accent);
  font-size: 1.8rem;
}

.external-video { display: grid; gap: var(--space-2); }
.external-frame { width: 100%; min-height: 200px; aspect-ratio: 16 / 9; border: 0; }
.question-link { display: block; margin-block: var(--space-2); }

.reveal {
  margin: 0;
  padding: var(--space-2) var(--space-3);
  border: 2px solid var(--color-ok);
  border-radius: var(--radius);
  background: var(--color-surface);
  color: var(--color-text);
  font-size: 1.25rem;
  font-weight: 700;
}

.reveal:empty {
  display: none;
}

/* Витрина на экране вопроса: тот же вопрос, под ним правильный ответ
   крупно, без рамки, цветом по судейству. */
.reveal-answer {
  margin: 0;
  font-weight: 750;
  font-size: clamp(1.6rem, 4vw, 2.6rem);
  line-height: 1.2;
  overflow-wrap: anywhere;
}
.reveal-answer.ok {
  color: var(--color-ok);
}
.reveal-answer.bad {
  color: var(--color-danger);
}
.tv-main .reveal-answer {
  font-size: clamp(36px, 5vw, 96px);
}
.player-mode .reveal-answer {
  font-size: clamp(26px, 6vw, 38px);
}

.delta-pos {
  color: var(--color-ok);
}

.delta-neg {
  color: var(--color-danger);
}

.question-card.glow-ok {
  box-shadow: 0 0 0 3px var(--color-ok);
}

.question-card.glow-bad {
  box-shadow: 0 0 0 3px var(--color-danger);
}

.q-fly-scale {
  animation: q-scale 400ms ease-out;
}

.q-fly-spin {
  animation: q-spin 500ms ease-out;
}

.player {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.buzz {
  flex: 1;
  width: 100%;
  min-height: 55dvh;
  font-size: 2rem;
  background: var(--color-accent);
  color: var(--color-bg);
}

.qr {
  display: block;
  width: min(16rem, 80vw);
  aspect-ratio: 1;
  height: auto;
  background: white;
  border-radius: 12px;
}

.invitation {
  display: grid;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.bubble {
  display: inline-flex;
  align-items: center;
  min-height: var(--touch-min);
  margin: var(--space-2);
  padding: var(--space-2) var(--space-4);
  background: var(--color-surface);
  border: 2px solid #9295a6;
  border-radius: var(--radius);
}

.bubble.ready {
  border-color: var(--color-ok);
}

.icon {
  display: inline-flex;
  flex: none;
  width: 1.25rem;
  height: 1.25rem;
  vertical-align: middle;
}

.icon svg {
  display: block;
  width: 100%;
  height: 100%;
}

.seat-line {
  margin: 0;
  font-size: 1.3rem;
}

/* Телевизор: открытый список игроков и поле без внешней карточки. */
.shell.tv-mode {
  display: block;
  width: 100%;
  max-width: none;
  min-height: 100dvh;
  padding: var(--tv-pad);
}

/* Панель звуков — на пульте и телефонах. На телевизоре она съедала
   высоту сцены и давала прокрутку на 1080p, поэтому здесь скрыта. */
.tv-mode .effects-control {
  display: none;
}

.tv-stage {
  display: grid;
  grid-template-columns: clamp(150px, 17vw, 320px) minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr);
  gap: clamp(16px, 2vw, 40px);
  height: calc(100dvh - 2 * var(--tv-pad));
  min-height: 0;
}

.tv-header {
  position: relative;
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: inherit;
  gap: inherit;
  align-items: center;
  min-width: 0;
}
.tv-header-side { display: contents; }
.tv-audience {
  position: static;
  z-index: 3;
  transform: none;
  pointer-events: none;
  min-height: 32px;
  white-space: nowrap;
}

.tv-header-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  min-width: 0;
}

.tv-header-main .now-playing {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  color: var(--color-muted);
  font-size: clamp(10px, 1vw, 18px);
  line-height: 1.2;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tv-header-main > button { flex: none; }

.tv-roster {
  display: flex;
  flex-direction: column;
  justify-content: safe center;
  gap: clamp(6px, 1vh, 12px);
  overflow: auto;
  min-width: 0;
  min-height: 0;
  padding: 28px;
}

.tv-player { flex: 0 0 auto; min-width: 0; }
.player-frame {
  border: 3px solid var(--color-text);
  background: var(--color-board);
  min-height: clamp(56px, 8.5vh, 96px);
  padding: clamp(6px, 0.6vw, 10px);
  display: grid;
  align-content: center;
  gap: 4px;
  text-align: center;
  transition: border-color 150ms ease-out, background-color 150ms ease-out;
}
.player-frame h2 {
  margin: 0;
  font-size: clamp(16px, 1.2vw, 22px);
  font-weight: 600;
  overflow-wrap: anywhere;
  line-height: 1.05;
}
/* Карточка игрока на ТВ — без рандомных шейпов: имя слева, очки справа, статус под строкой. */
.tv-player .player-frame {
  margin: 0;
  border-color: #9295a6;
  text-align: left;
}
.player-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.player-row h2 {
  flex: 1 1 auto;
  min-width: 0;
}
/* Отвечающий (на телеке идёт его таймер): полупрозрачное фоновое свечение. */
.tv-player.answering .player-frame {
  border-color: var(--color-accent);
  background: color-mix(in srgb, var(--color-board), var(--color-accent) 14%);
  box-shadow: 0 0 24px 2px color-mix(in srgb, var(--color-accent), transparent 55%);
}
@media (prefers-reduced-motion: no-preference) {
  .tv-player.answering .player-frame {
    animation: answer-glow 1.2s ease-in-out infinite alternate;
  }
}
@keyframes answer-glow {
  from { box-shadow: 0 0 12px 0 color-mix(in srgb, var(--color-accent), transparent 65%); }
  to { box-shadow: 0 0 24px 3px color-mix(in srgb, var(--color-accent), transparent 45%); }
}
.tv-player .bubble-points {
  margin: 0;
  font-size: clamp(15px, 1.2vw, 22px);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--color-accent);
  overflow-wrap: anywhere;
  text-align: right;
  white-space: nowrap;
}
.tv-player .bubble-points span { font-size: 0.5em; font-weight: 400; color: var(--color-muted); }
.tv-player.ready:not(.answer-correct):not(.answer-wrong):not(.disconnected) .player-frame { border-color: var(--color-ok); }
.answer-correct .player-frame { border-color: var(--color-ok); }
.answer-wrong .player-frame { border-color: var(--color-danger); }
.answer-state { margin: 0; font-size: clamp(12px, 0.9vw, 15px); min-height: 1em; text-align: left; }
.answer-state:empty { display: none; }
.answer-correct .answer-state { color: var(--color-ok); }
.answer-wrong .answer-state { color: var(--color-danger); }
.disconnected { color: var(--color-muted); }
.disconnected .player-frame { background: #39394d; border-color: #f3a84e; }
.connection-state { margin: 0; display: flex; align-items: center; justify-content: flex-start; gap: 6px; font-size: clamp(11px, 0.8vw, 14px); text-align: left; }
/* Рисованное имя в тесной колонке ТВ: иначе SVG 8/3 растягивает карточку и 6 игроков не влезают в 1080p. */
.tv-player .drawn-name { width: min(100%, 140px); max-width: 140px; max-height: 52px; margin: 0; display: block; }
.spinner { display: inline-block; flex: 0 0 auto; width: 1em; height: 1em; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: reconnect-spin 1s linear infinite; }
.tv-main { min-width: 0; min-height: 0; display: flex; flex-direction: column; gap: var(--board-gap); }
.round-label { margin: 0; color: var(--color-muted); font-size: clamp(14px, 1.3vw, 24px); text-align: right; }
.tv-lobby { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: clamp(16px, 3vh, 32px); text-align: center; }
.tv-lobby h2 { font-size: clamp(28px, 3vw, 56px); color: var(--color-accent); }
.tv-lobby .note { max-width: 38em; font-size: clamp(18px, 1.8vw, 30px); }
.tv-lobby .qr { width: min(32vh, 300px); }
.tv-lobby .invite-word { font-size: clamp(32px, 4vw, 64px); font-weight: 600; }
.game-board { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(var(--columns), minmax(0, 1fr)); gap: var(--board-gap); }
.game-board .theme { display: flex; flex-direction: column; min-width: 0; min-height: 0; gap: var(--board-gap); }
.game-board .theme h2 { flex: 1.7; min-height: 0; background: var(--color-board); display: grid; place-items: center; text-align: center; color: var(--color-accent); font-size: clamp(20px, calc(12vw / var(--columns)), 48px); font-weight: 650; line-height: 1.15; padding: 10px; overflow-wrap: anywhere; overflow: auto; }
.game-board .cells { flex: var(--rows); min-height: 0; grid-template-columns: minmax(0, 1fr); grid-template-rows: repeat(var(--rows), minmax(0, 1fr)); gap: var(--board-gap); }
.game-board .cell { min-width: 0; min-height: 0; padding: 4px; border-radius: 0; font-size: clamp(18px, min(calc(20vw / var(--columns)), calc(40vh / (var(--rows) + 2))), 76px); font-weight: 600; color: var(--color-accent); font-variant-numeric: tabular-nums; }
.game-board .cell.used { opacity: 1; color: transparent; background: color-mix(in srgb, var(--color-board), var(--color-bg) 55%); }
.tv-main .question-card { flex: 1; min-height: 0; border-radius: var(--radius); background: var(--color-board); text-align: center; grid-template-rows: auto minmax(0, 1fr) auto; align-content: stretch; padding: clamp(20px, 3vw, 60px); overflow: auto; }
.tv-main .question-meta { align-self: start; }
.tv-main .question-card.answer-timer-active .question-meta { max-width: calc(100% - clamp(120px, 13vw, 200px) - var(--board-gap)); margin-inline: auto; }
.tv-main .question-content { min-width: 0; min-height: 0; }
.tv-main .question-card.answer-timer-active .question-content { max-width: calc(100% - clamp(120px, 13vw, 200px) - var(--board-gap)); margin-inline: auto; }
.tv-main .question-text { align-self: center; max-width: 100%; font-size: clamp(32px, 4.5vw, 88px); font-weight: 600; line-height: 1.15; color: var(--color-accent); }
.tv-main .theme-name, .tv-main .price { font-size: clamp(20px, 2vw, 36px); color: var(--color-muted); }
.tv-main .question-meta .price { color: #171616; }
.tv-main .holder { font-size: clamp(24px, 2.4vw, 44px); }
.tv-main .answer-timer { --timer-size: clamp(120px, 13vw, 200px); }
.tv-main .timer-wrap { top: clamp(12px, 2vw, 32px); right: clamp(12px, 2vw, 32px); }
.tv-main .timer-expired { font-size: clamp(24px, 2.8vw, 52px); font-variant-numeric: tabular-nums; }
.tv-main .question-card.glow-ok, .tv-main .question-card.glow-bad { box-shadow: none; }
.tv-main > div:not([class]) { flex: 1; display: grid; align-content: center; gap: 20px; }
.tv-main .seat-line { font-size: clamp(24px, 2.8vw, 52px); }
.tv-main > .note { margin: auto; max-width: 28em; text-align: center; color: var(--color-accent); font-size: clamp(28px, 3vw, 56px); }
/* Название трека в 3 раза меньше крупного примечания ТВ: было clamp(28px, 3vw, 56px). */
.tv-main > .note.now-playing {
  margin: 0;
  max-width: 100%;
  text-align: center;
  color: var(--color-muted);
  font-size: clamp(9px, 1vw, 19px);
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.tv-mode > .note:not([hidden]), .tv-mode > [role="alert"] { position: fixed; z-index: 2; top: 12px; left: 50%; transform: translateX(-50%); background: var(--color-bg); padding: 12px 20px; border: 1px solid var(--color-danger); }

/* Телефон: имя и счёт сверху, вопрос и большая кнопка в зоне большого пальца. */
.shell.player-mode { padding-top: calc(16px + env(safe-area-inset-top)); }
.player-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.player-top h2 { font-size: clamp(22px, 6vw, 32px); overflow-wrap: anywhere; }
.player-points { flex: 0 0 auto; text-align: right; }
.player-points .score { color: var(--color-accent); font-size: 32px; font-weight: 600; }
.player-points span { color: var(--color-muted); font-size: 14px; }
.player-mode .question-card { background: var(--color-board); padding: 20px; padding-right: 76px; gap: 10px; border-radius: var(--radius-lg); }
.player-mode .timer-wrap { top: 10px; right: 10px; }
.player-mode .question-text { font-size: clamp(22px, 5vw, 30px); line-height: 1.25; color: var(--color-accent); }
.player-mode .theme-name { color: var(--color-muted); font-size: 14px; }
.player-mode .price { color: var(--color-accent); font-weight: 600; }
.player-mode .question-meta .price { color: #171616; }
.player-mode .answer-timer { --timer-size: 56px; }
.player-mode .timer-expired {
  width: 56px; font-size: 16px; font-weight: 600; line-height: 1.1; text-align: center;
}
.player-mode .question-card:has(.timer-expired) > .question-meta { min-height: 36px; }
.player-mode .buzz { min-height: clamp(180px, 35dvh, 360px); font-size: clamp(32px, 8vw, 48px); font-weight: 600; border-radius: var(--radius-lg); box-shadow: 0 6px 0 #ab862f; }
.player-mode .buzz:disabled { background: var(--color-surface); color: var(--color-muted); box-shadow: none; opacity: 1; }
.player-mode .buzz:active:enabled { transform: scale(0.96); }
.player details { color: var(--color-muted); font-size: 14px; }
.player details summary { min-height: var(--touch-min); display: flex; align-items: center; cursor: pointer; }
.player details ol { padding-left: 24px; }
.player-turn-note.my-turn { color: var(--color-accent); font-size: clamp(20px, 4vw, 28px); font-weight: 700; line-height: 1.25; text-align: center; }
.player .delta:empty { display: none; }
.player .delta { font-size: 20px; }

/* Телефон при подключённом телевизоре: карточка и кнопка внутри доступного окна. */
.player-mode .player.compact {
  height: calc(100dvh - 120px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  min-height: 240px;
  max-height: none;
  overflow: visible;
  gap: 8px;
}
.player-mode .player.compact .question-card {
  padding: 12px;
  padding-right: 72px;
  gap: 6px;
  flex: 1 1 auto;
  min-height: 64px;
  max-height: 40dvh;
  overflow: auto;
}
.player-mode .player.compact .question-text { font-size: clamp(16px, 4vw, 20px); }
.player-mode .player.compact .question-image { max-height: 28vh; }
.player-mode .player.compact .question-media audio,
.player-mode .player.compact .question-media video { max-height: 28vh; }
.player-mode .player.compact .buzz { flex: 0 0 auto; min-height: clamp(100px, 28dvh, 240px); }
.player-mode .player.compact .player-top, .player-mode .player.compact > .note { flex-shrink: 0; }
.player-mode .player.compact .delta { display: none; }
.player-mode .player.compact details { display: none; }

/* Экран ответа: карточка занимает не больше 3/4 экрана, кнопка — весь остаток. */
@media (max-width: 600px) and (orientation: portrait) {
  .shell.player-mode:has(.player .buzz:not([hidden])) {
    box-sizing: border-box;
    height: 100dvh;
    min-height: 0;
    max-height: 100dvh;
    overflow: hidden;
    grid-template-rows: auto minmax(0, 1fr);
    padding-top: calc(12px + env(safe-area-inset-top));
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
  }
  .player-mode .player:has(.buzz:not([hidden])) {
    height: 100%;
    min-height: 0;
    max-height: 100%;
    overflow: hidden;
    gap: 8px;
  }
  .player-mode .player:has(.buzz:not([hidden])) .player-top { flex: 0 0 auto; }
  .player-mode .player:has(.buzz:not([hidden])) > .delta,
  .player-mode .player:has(.buzz:not([hidden])) > details { display: none !important; }
  .player-mode .player:has(.buzz:not([hidden])) .question-card {
    flex: 0 1 auto;
    min-height: 0;
    max-height: 75%;
    overflow: hidden;
    grid-template-rows: auto minmax(0, 1fr) auto;
  }
  .player-mode .player:has(.buzz:not([hidden])) .question-content {
    min-height: 0;
    overflow: hidden;
  }
  .player-mode .player:has(.buzz:not([hidden])) .question-text {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 5;
  }
  .player-mode .player:has(.buzz:not([hidden])) .question-image { max-height: 18dvh; object-fit: contain; }
  .player-mode .player:has(.buzz:not([hidden])) .question-media audio,
  .player-mode .player:has(.buzz:not([hidden])) .question-media video { max-height: 18dvh; }
  .player-mode .player:has(.buzz:not([hidden])) .buzz {
    flex: 1 1 0;
    min-height: 0;
    max-height: none;
    width: 100%;
  }
}

@keyframes reconnect-spin { to { transform: rotate(360deg); } }
@media (max-width: 600px) {
  .tv-stage { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto minmax(0, 1fr); gap: 12px; }
  .tv-header { display: flex; gap: 12px; }
  .tv-brand { width: clamp(52px, 14vw, 72px); }
  .tv-header-main { flex: 1; gap: 8px; }
  .tv-header-main .now-playing { text-align: left; }
  .tv-header-main .round-label { font-size: 12px; }
  .tv-roster { flex-direction: row; justify-content: start; gap: 12px; max-height: 180px; padding: 28px; }
  .tv-roster .change-role { margin: 0 0 0 auto; padding: 8px; width: auto; flex: none; align-self: center; }
  .tv-player { width: 150px; }
  .player-frame { min-height: 72px; padding: 8px; }
  .player-frame h2 { font-size: 20px; }
  .roster-score { font-size: 24px; }
  .tv-main .question-text { font-size: clamp(24px, 6vw, 36px); }
  .tv-main .question-card { padding: 16px; }
  .game-board .theme h2 { font-size: 20px; padding: 8px; }
  .game-board .cell { font-size: 36px; }
}
@media (prefers-reduced-motion: reduce) {
  .q-fly-scale, .q-fly-spin, .question-card.modifier { animation: none; }
  .answer-timer .ring-fill { transition: none; }
  .spinner { animation: none; }
  .player-frame { transition: none; }
  .tv-player.answering .player-frame { animation: none; }
  .prompter-feed { scroll-behavior: auto; }
  .player-mode .buzz:active:enabled { transform: none; }
}

@keyframes modifier-in {
  from {
    transform: scale(0.92);
    opacity: 0;
  }

  to {
    transform: none;
    opacity: 1;
  }
}

@keyframes q-scale {
  from {
    transform: scale(0.86);
    opacity: 0;
  }

  to {
    transform: none;
    opacity: 1;
  }
}

@keyframes q-spin {
  from {
    transform: rotateY(70deg);
    opacity: 0;
  }

  to {
    transform: none;
    opacity: 1;
  }
}

@media (orientation: landscape) {
  .shell {
    align-content: center;
    justify-content: center;
    min-height: 100svh;
  }

  .shell.wide:not(.tv-mode) {
    max-width: var(--content-board);
  }
}

@media (orientation: portrait) {
  .shell {
    align-content: start;
  }
}

/* Host desk: two anchored sidebars and a control dock outside the scroll. */
.shell.wide:not(.tv-mode) { max-width: none; width: 100%; }
.shell:has(.host-desk) { --host-col-left: 300px; --host-col-right: 330px; --host-col-gap: 16px; --host-inset: 12px; display: block; padding: 12px; padding-bottom: calc(88px + env(safe-area-inset-bottom)); }
.host-desk, .host-desk.playing { display: grid; grid-template-columns: var(--host-col-left) minmax(0, 1fr) var(--host-col-right); gap: var(--host-col-gap); height: calc(100dvh - 112px - env(safe-area-inset-bottom)); min-width: 0; }
.host-library { display: flex; flex-direction: column; gap: 16px; min-height: 0; border-right: 1px solid var(--color-surface); padding-right: 16px; overflow-y: auto; scrollbar-width: thin; }
.host-library-restart { margin-top: auto; width: 100%; }
.host-library-rethemes { margin-top: auto; width: 100%; }
.host-library-rethemes:not([hidden]) + .host-library-restart { margin-top: 0; }
@media (min-width: 900px) {
  .host-library-restart { margin-bottom: 104px; }
}

/* Низкий десктоп (200% и маленькие окна): ужатый сайдбар, чтобы кнопки
   сброса влезали без прокрутки. Скролл .host-library остаётся страховкой. */
@media (min-width: 900px) and (max-height: 700px) {
  .host-library { gap: 8px; padding-right: 12px; }
  .host-library .game-summary { min-height: 0; gap: 8px; }
  .host-library .game-summary .summary-head { padding: 8px; }
  .host-library .invitation { gap: 6px; }
  .host-library .invitation .qr { width: min(100%, 16dvh); }
  .host-library .room-members { margin-block: 0.5rem; }
}
.pack-chooser { display: flex; flex-direction: column; gap: 12px; min-height: 0; overflow-y: auto; flex: 1; }
.pack-chooser h2, .sound-panel h2, .game-format h2 { margin: 0; font-size: 17px; }
.pack-chooser .note, .music-player .note { font-size: 12px; line-height: 1.45; }
.pack-list { display: grid; gap: 6px; }
.pack-entry { display: grid; grid-template-columns: minmax(0, 1fr) 34px; align-items: center; gap: 4px; padding: 6px; border: 1px solid var(--color-surface); border-radius: 8px; }
.pack-entry.selected { border: 3px solid var(--color-accent); background: var(--color-surface); padding: 4px; }
.pack-entry .pack-choice { grid-column: 1; grid-row: 1; min-width: 0; min-height: 0; padding: 6px; background: transparent; text-align: start; }
.pack-entry .pack-choice[aria-pressed="true"] { border-color: transparent; background: transparent; color: var(--color-accent); }
.pack-name { display: block; min-width: 0; font-size: 13px; line-height: 1.4; overflow-wrap: anywhere; }
.pack-entry .pack-choice { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; }
.pack-origin { display: block; color: var(--color-muted); font-size: 10px; line-height: 1.3; }
.pack-edit { grid-column: 2; grid-row: 1; display: inline-grid; place-items: center; width: 34px; min-width: 34px; height: 34px; min-height: 34px; padding: 7px; background: transparent; color: var(--color-muted); }
.pack-edit:hover { color: var(--color-accent); }
.pack-edit .icon { width: 1.1rem; height: 1.1rem; }
.pack-modal-overlay { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; align-content: safe center; gap: 12px; padding: 16px; overflow-y: auto; background: rgb(0 0 0 / .55); }
.pack-modal { width: min(480px, calc(100vw - 32px)); display: grid; gap: 12px; padding: 20px; background: var(--color-bg); border: 1px solid var(--color-surface); border-radius: 16px; box-shadow: 0 16px 48px rgb(0 0 0 / .45); }
.pack-modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.pack-modal-head h3 { margin: 0; font-size: 17px; }
.pack-modal-head .icon-button { width: 34px; min-width: 34px; height: 34px; min-height: 34px; }
.pack-modal-name { display: grid; gap: 8px; font-size: 13px; color: var(--color-muted); }
.pack-modal-name textarea { width: 100%; min-height: 56px; padding: 8px; resize: vertical; font-size: 15px; color: var(--color-text); }
.pack-modal-error { margin: 0; color: var(--color-danger); font-size: 13px; }
.pack-modal-error:empty { display: none; }
.pack-modal-foot { display: flex; justify-content: flex-end; gap: 8px; }
.pack-confirm { gap: 16px; }
.pack-confirm p { margin: 0; font-size: 15px; line-height: 1.5; }
.host-library .invitation { flex: none; margin: 0; gap: 8px; }
.host-library .invitation .row { gap: 6px; align-items: center; flex-wrap: nowrap; }
.host-library .invitation label { min-width: 0; font-size: 12px; container-type: inline-size; }
.host-library .invitation input { width: 100%; min-width: 0; height: 44px; min-height: 44px; padding: 8px; font-size: clamp(8.5px, calc(190cqi / var(--invite-length, 44)), 12px); }
.copy-invite { width: 44px; min-width: 44px; height: 44px; min-height: 44px; padding: 8px; aspect-ratio: 1; border-radius: 12px; flex: none; }
.copy-invite .icon { width: 24px; height: 24px; flex: none; }
.host-library .invitation .note { min-height: 16px; font-size: 11px; }
.host-library .qr { width: min(100%, 25dvh); height: auto; aspect-ratio: 1; align-self: center; border-radius: 10px; }
.host-center, .host-stage { display: flex; flex-direction: column; min-width: 0; min-height: 0; height: 100%; }
.host-stage { position: relative; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #77799855 transparent; }
.host-lobby { display: flex; flex-direction: column; gap: 20px; flex: 1; min-height: 0; }
.host-setup { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.host-setup .sound-panel, .host-setup .game-format { display: grid; align-content: start; gap: 10px; }
.host-setup .row { gap: 6px; }
.host-setup button { padding: 8px; font-size: 13px; }
.host-setup .note { font-size: 12px; }
.player-canvas { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(var(--player-columns), minmax(0, 1fr)); grid-auto-rows: minmax(min(96px, 16vh), min(21vh, 230px)); align-content: start; place-items: stretch; gap: 16px 24px; padding: 24px; overflow: auto; position: relative; }
.player-canvas .bubble { min-width: 0; width: min(100%, 340px); max-height: 100%; aspect-ratio: 1.35; margin: 0; padding: 28px; display: flex; flex-direction: column; justify-content: center; gap: 8px; text-align: center; min-height: 0; border-width: 3px; border-color: #9295a6; }
.host-lobby .player-canvas .bubble { position: relative; }
.host-lobby .bubble-remove { position: absolute; z-index: 2; inset: 8px 8px auto auto; display: grid; place-items: center; width: 32px; min-width: 32px; height: 32px; min-height: 32px; padding: 0; border: 1px solid #ffffff20; border-radius: 50%; background: #ffffff18; color: var(--color-text); opacity: .78; }
.host-lobby .bubble-remove { background: transparent; border: 0; }
.host-lobby .bubble-remove::before { content: ""; position: absolute; inset: 3px; border: 1px solid #ffffff20; border-radius: 50%; background: #ffffff18; pointer-events: none; }
.host-lobby .bubble-remove:hover, .host-lobby .bubble-remove:focus-visible { opacity: 1; background: transparent; }
.host-lobby .bubble-remove:hover::before, .host-lobby .bubble-remove:focus-visible::before { background: #ffffff2b; }
.host-lobby .bubble-remove .icon, .host-lobby .bubble-remove svg { width: 14px; height: 14px; }
.player-canvas .drawn-name { width: 100%; height: 100%; min-height: 0; max-height: 190px; }
.bubble-status { font-size: 12px; color: var(--color-muted); }
.bubble.ready .bubble-status { color: var(--color-ok); }
.bubble.offline { opacity: 1; border-color: #f3a84e; }
.canvas-empty { grid-column: 1 / -1; text-align: center; color: var(--color-muted); align-self: center; width: min(100%, 360px); justify-self: center; line-height: 1.6; padding: 24px; border: 1px dashed color-mix(in srgb, var(--color-muted) 38%, transparent); border-radius: 16px; background: color-mix(in srgb, var(--color-board) 42%, transparent); }
.host-right { display: flex; flex-direction: column; gap: 16px; min-height: 0; }
.host-right .sound-panel { margin-bottom: 0; }
.music-player { flex: none; display: grid; grid-template-columns: 1fr auto; gap: 10px; padding: 0 0 14px; border-bottom: 1px solid var(--color-surface); }
.music-heading { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; }
.music-player button { padding: 8px 10px; font-size: 13px; }
.music-player .row { gap: 6px; }
.prompter { min-width: 0; min-height: 0; flex: 1; display: flex; flex-direction: column; gap: 10px; border-left: 2px solid var(--color-surface); padding: 0 0 0 14px; }
.prompter h2 { margin: 0; font-size: 17px; }
.prompter-legend { margin: 0; font-size: 11px; line-height: 1.4; color: var(--color-muted); }
.prompter-feed { flex: 1; min-height: 0; display: grid; grid-template-rows: minmax(0, 1fr) auto minmax(0, 1fr); gap: 10px; overflow: hidden; }
.prompter-history { min-height: 0; display: flex; flex-direction: column; justify-content: end; gap: 12px; overflow: hidden; mask-image: linear-gradient(to bottom, transparent, #000 24%); }
.prompter-step { display: grid; gap: 6px; flex: none; opacity: .35; transition: opacity 200ms ease; }
.prompter-step[hidden] { display: none; }
.prompter-current { grid-row: 2; align-self: center; display: grid; gap: 8px; }
.prompter-feed.no-history { grid-template-rows: auto auto minmax(0, 1fr); align-content: start; }
.prompter-feed.no-history .prompter-history { display: none; }
.prompter-feed.no-history .prompter-current { grid-row: 1; align-self: start; }
.prompter-feed.no-history .prompter-forecast { grid-row: 2; }
.prompter-forecast { min-height: 0; align-self: start; overflow: hidden; }
.prompter-live-note { margin: 0; min-height: 1.4em; font-size: 11px; line-height: 1.4; color: var(--color-muted); }
.prompter-line { margin: 0; font-size: 12px; line-height: 1.55; color: var(--color-muted); overflow-wrap: anywhere; }
.prompter-line.spoken { font-size: clamp(18px, 1.4vw, 23px); line-height: 1.5; color: var(--color-accent); font-weight: 500; }
.prompter-line .drawn-name { width: 82px; }
@keyframes prompt-arrive { from { transform: translateY(16px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.host-dock { position: fixed; z-index: 20; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: var(--host-col-left) minmax(0, 1fr) var(--host-col-right); align-items: center; gap: var(--host-col-gap); padding: 12px var(--host-inset) calc(12px + env(safe-area-inset-bottom)); background: var(--color-bg); border-top: 1px solid var(--color-surface); min-height: 76px; }
.host-status { display: grid; gap: 5px; font-size: 14px; }
.host-status-line { display: flex; align-items: center; gap: 8px; min-width: 0; }
.host-status-line .host-round-title { flex: 1 1 auto; }
.host-status .host-undo { flex: none; }
.host-round-title { display: block; min-width: 0; max-width: 100%; overflow: hidden; font-weight: 800; letter-spacing: -.4px; line-height: 1.15; white-space: nowrap; }
.roster-pills { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.host-departed { color: var(--color-muted); font-size: 12px; }
.host-departed:empty { display: none; }
.host-menu { position: absolute; z-index: 36; top: calc(100% + 6px); left: max(8px, env(safe-area-inset-left)); display: grid; gap: 6px; width: min(280px, calc(100vw - 24px)); padding: 8px; border: 1px solid #404675; border-radius: 16px; background: #1b1d4e; box-shadow: 0 16px 40px #000a; }
.host-menu button { display: flex; align-items: center; justify-content: flex-start; gap: 8px; width: 100%; min-height: 44px; margin: 0; padding: 8px 12px; text-align: left; }
.host-menu .icon { width: 18px; height: 18px; flex: none; }
.host-menu-backdrop { position: fixed; z-index: 34; inset: 0; width: 100%; height: 100%; min-height: 100%; margin: 0; padding: 0; border: 0; border-radius: 0; background: transparent; }
.host-controls { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 8px; min-width: 0; }
.host-controls > .note { display: none; }
.host-controls .row { gap: 6px; }
.host-controls > .judge-actions { flex-wrap: nowrap; width: 100%; }
.host-controls > .judge-actions > button { flex: 1 1 0; min-width: 0; }
.host-controls button { padding: 8px 12px; font-size: 13px; }
.host-controls .host-turn-tools > button:not([hidden]):not(.room-reset), .host-controls .picker-menu summary { min-height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; text-align: center; }
.host-controls .start-game { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-size: 15px; text-transform: uppercase; font-weight: 750; min-width: 190px; letter-spacing: .04em; }
.host-controls .start-game { flex: 0 0 auto; width: auto; justify-content: center; gap: 8px; }
@media (min-width: 900px) and (min-height: 581px) {
  .host-controls:has(.start-game:not([hidden])) { position: relative; justify-content: flex-end; min-height: 44px; }
  .host-controls > .start-game:not([hidden]) { position: absolute; left: 50%; transform: translateX(-50%); }
}
.picker-menu { position: relative; font-size: 12px; }
.picker-menu summary { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; list-style: none; padding: 9px 12px; min-height: 40px; border: 1px solid color-mix(in srgb, var(--color-muted) 45%, transparent); border-radius: 12px; background: color-mix(in srgb, var(--color-surface) 75%, transparent); color: var(--color-text); font-weight: 600; transition: border-color 140ms ease, background 140ms ease; }
.picker-menu summary::-webkit-details-marker { display: none; }
.picker-menu summary::after { content: ""; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(225deg) translateY(-1px); opacity: .7; }
.picker-menu[open] summary { border-color: var(--color-accent); color: var(--color-accent); }
.picker-menu[open] summary::after { transform: rotate(45deg) translateY(-1px); }
.picker-menu[open] > .row { position: absolute; bottom: calc(100% + 8px); left: 0; width: min(300px, calc(100vw - 24px)); max-height: min(50vh, 420px); overflow-y: auto; display: grid; gap: 7px; background: color-mix(in srgb, var(--color-surface) 96%, black); border: 1px solid color-mix(in srgb, var(--color-muted) 25%, transparent); padding: 10px; border-radius: 14px; box-shadow: 0 12px 36px #0008; }
.picker-menu[open] > .row button { width: 100%; text-align: left; justify-content: flex-start; }
.picker-menu .drawn-name { width: 88px; max-height: 30px; }
.host-library :is(button.press:not(.icon-button), .game-format button, .picker-menu summary) { min-height: 38px; padding: 6px 10px; font-size: 12px; line-height: 1.2; }
.dock-volume { display: grid; grid-template-columns: 44px minmax(0, 1fr); align-items: center; gap: 8px; margin: 0; font-size: 12px; }
.dock-volume .volume-row { display: grid; gap: 8px; margin: 0; grid-column: 2; min-width: 0; }
.dock-volume .volume-row > span { white-space: nowrap; }
.dock-volume .dock-effects { grid-column: 1; grid-row: 1 / span 2; }
.host-dock .volume-row { gap: 4px; font-size: 11px; }
.dock-effects { padding: 8px; }
.dock-effects[aria-pressed="false"] { opacity: .5; }
.dock-volume input { padding: 0; width: 100%; min-height: 20px; accent-color: var(--color-accent); }
.host-header-reveal { display: none; }
.host-board { --board-gap: clamp(4px, .5vw, 10px); min-height: 0; height: 100%; }
.host-board .theme h2 { font-weight: 500; flex: 1.3; font-size: clamp(12px, calc(7vw / var(--columns)), 28px); }
.host-board .theme { container-type: size; }
.host-board .cells { container-type: size; }
.host-board .cell { padding: 0 6px; min-width: 0; min-height: 0; line-height: 1.05; white-space: nowrap; overflow: hidden; font-size: clamp(12px, min(calc(100cqw / 2.1), calc((100cqh - (var(--rows) - 1) * var(--board-gap)) / var(--rows) * .62)), 64px); }
.host-board .cell:enabled:hover { background: color-mix(in srgb, var(--color-board), white 12%); }
.host-board .cell:focus-visible { outline: 3px solid var(--color-accent); outline-offset: -3px; }
.host-stage .question-card { flex: 1; min-height: 0; border-radius: 12px; background: var(--color-board); text-align: center; grid-template-rows: auto minmax(0, 1fr) auto auto auto; overflow: visible; }
.host-stage .host-question { overflow: visible; }
.host-stage .host-tv-question-layer { flex: 1 1 0; min-height: 0; }
/* Разметка текущего вопроса: одна невысокая строка внизу карточки хоста — сначала пилюли на оценку, после них ввод своей метки. */
.topic-strip { position: sticky; bottom: 0; z-index: 1; display: flex; align-items: center; gap: 4px; height: 26px; min-width: 0; overflow: visible; }
.topic-strip[hidden] { display: none; }
.topic-pills { flex: 0 1 auto; display: flex; align-items: center; gap: 4px; min-width: 0; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.topic-pills::-webkit-scrollbar { display: none; }
.topic-pills:empty { display: none; }
.topic-pill { --topic-color: var(--color-muted); flex: none; display: inline-flex; align-items: center; gap: 1px; height: 18px; padding: 0 1px 0 7px; border: 1px solid color-mix(in srgb, var(--topic-color) 60%, transparent); border-radius: 999px; background: color-mix(in srgb, var(--topic-color) 18%, var(--color-board)); color: var(--topic-color); font-size: 11px; font-weight: 600; line-height: 1; white-space: nowrap; }
.topic-pill.candidate { border-style: dashed; }
.topic-pill .pill-label { max-width: 18ch; overflow: hidden; text-overflow: ellipsis; }
.topic-pill .pill-vote { display: inline-grid; place-items: center; width: 16px; height: 16px; min-width: 0; min-height: 0; padding: 0; border: 0; border-radius: 50%; background: transparent; color: inherit; opacity: .7; cursor: pointer; }
.topic-pill .pill-vote .icon { width: 11px; height: 11px; }
.topic-pill .pill-vote:hover { opacity: 1; background: color-mix(in srgb, var(--topic-color) 25%, transparent); }
.topic-pill .pill-vote[aria-pressed="true"] { opacity: 1; color: #fff; }
.topic-pill .pill-vote:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 0; }
.topic-add { flex: none; display: flex; margin-left: 2px; }
.topic-add input { width: 132px; height: 22px; padding: 0 8px; font: inherit; font-size: 11px; color: var(--color-text); border: 1px solid transparent; border-radius: 999px; background: color-mix(in srgb, var(--color-bg) 55%, var(--color-board)); }
.topic-add input::placeholder { color: color-mix(in srgb, var(--color-muted) 75%, transparent); }
.topic-add input:hover { border-color: color-mix(in srgb, var(--color-muted) 30%, transparent); }
.topic-add input:focus-visible { outline: none; border-color: var(--color-accent); }
.topic-add.invalid input { border-color: var(--color-danger); }
.topic-error { position: absolute; right: 8px; bottom: calc(100% + 2px); margin: 0; padding: 2px 8px; font-size: 11px; line-height: 1.4; color: var(--color-danger); background: var(--color-bg); border-radius: 6px; white-space: nowrap; }
.topic-error[hidden] { display: none; }
.host-stage .question-text, .host-stage .has-media .question-text { color: var(--color-accent); font-size: clamp(20px, 2.2vw, 34px); line-height: 1.2; }
.host-stage .question-image { max-height: 40dvh; }
/* Длинный вопрос с картинкой прокручивается внутри своей строки, а не наезжает на ответ. */
.host-stage .question-content { min-width: 0; min-height: 0; }
.host-right .final-judges { max-height: 40vh; overflow-y: auto; }
@media (max-width: 1199px) {
  .shell:has(.host-desk) { --host-col-left: 230px; --host-col-right: 250px; --host-col-gap: 12px; }
  .host-setup { grid-template-columns: 1fr; gap: 16px; }
  .player-canvas { grid-template-columns: repeat(min(2, var(--player-columns)), minmax(0, 1fr)); gap: 16px; }
}
@media (max-width: 899px), (max-height: 420px) {
  .shell:has(.host-desk) { padding-bottom: calc(176px + env(safe-area-inset-bottom)); }
  .host-desk, .host-desk.playing { height: auto; grid-template-columns: minmax(0, 1fr); }
  .host-library { border: 0; padding: 0; flex-direction: row; align-items: start; }
  .pack-chooser { max-height: 320px; flex: 1; }
  .host-library .invitation { width: 160px; }
  .host-library .invitation label { font-size: 11px; }
  .host-library .invitation .row { flex-wrap: nowrap; }
  .host-library .invitation input { font-size: 10px; }
  .host-library .copy-invite { padding: 5px; min-width: 34px; }
  .host-center { min-height: 460px; }
  .host-setup { grid-template-columns: 1fr; }
  .host-right { min-height: 360px; }
  .prompter-feed { max-height: 300px; }
  .host-dock { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); padding: 8px 12px calc(8px + env(safe-area-inset-bottom)); gap: 8px; }
  .host-controls { grid-column: 1 / -1; grid-row: 1; }
  .host-status { grid-column: 1; }
  .dock-volume { grid-column: 2; }
  .host-board { min-width: 650px; height: 420px; flex: none; }
  .host-stage { overflow-x: auto; }
  .host-board .cell { font-size: 28px; min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) {
  .prompter-step { animation: none !important; transition: none; }
  .prompter-feed { scroll-behavior: auto; }
}
.effects-control { display: flex; align-items: center; gap: .75rem; justify-content: flex-end; margin-bottom: .5rem; }
.effects-control a { font-size: .8rem; }
.effects-control button { font-size: .8rem; padding: .35rem .65rem; }
.sound-panel button[aria-pressed="true"] { border-color: var(--color-accent); color: var(--color-accent); }
.tv-phase-note { margin: 0; font-size: clamp(20px, 2vw, 36px); color: var(--color-accent); text-align: center; }
.change-role { margin-top: 16px; font-size: 14px; }
.tv-roster .change-role { margin-top: auto; padding: 4px 2px; font-size: 10px; line-height: 1.2; min-height: 0; width: 100%; background: transparent; color: var(--color-muted); opacity: .36; }
.tv-roster .change-role:hover, .tv-roster .change-role:focus-visible { opacity: .9; }

/* Итоги: общий раздел; строки игроков рисует общий лидерборд (results.css). */
.round-summary { min-height: 0; overflow: auto; padding: 8px 0; }
.round-summary > h2 { margin-bottom: 20px; font-size: clamp(24px, 2.5vw, 44px); }
.tv-main > .round-summary { flex: 1; }
@media (max-height: 500px) {
  .player-mode .effects-control { position: fixed; z-index: 10; top: calc(8px + env(safe-area-inset-top)); right: 12px; display: flex; gap: 8px; margin: 0; }
  .player-mode .player.compact { height: calc(100dvh - 40px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); }
  .player-mode .player-top h2 { font-size: 22px; }
  .player-mode .player.compact .question-card { max-height: 45dvh; }
  .player-mode .player.compact .buzz { min-height: 80px; }
}

.drawn-name { aspect-ratio: auto; max-height: 100px; }
.host-center { overflow: hidden; }
.host-desk .bubble.ready { border-color: var(--color-ok); }
.host-desk .bubble.offline, .disconnected .player-frame { opacity: 1; background: var(--color-surface); border-color: #f3a84e; }
.host-desk .bubble.connection-failed, .connection-failed .player-frame { border-color: var(--color-danger); }
.host-desk .bubble.left, .host-desk .bubble.left.connection-failed { border-color: var(--color-danger); }
.player-canvas .bubble-status { font-size: 11px; }
.host-dock .dock-volume { grid-template-columns: 28px minmax(0, 1fr); gap: 4px 8px; }
.host-dock .dock-effects { grid-row: 1 / 3; width: 28px; min-width: 28px; padding: 4px; }
.host-dock .volume-row { grid-template-columns: 88px minmax(0, 1fr); align-items: center; gap: 6px; }
.host-dock .volume-row > span { white-space: nowrap; }
.host-dock .volume-row input { min-height: 20px; min-width: 0; transform: scaleY(.9); transform-origin: center; }
.host-controls .start-game { letter-spacing: 0; }
.host-library { gap: 14px; }
.host-library .invitation .note:empty { display: none; }
.host-library .qr { max-height: 25dvh; object-fit: contain; }
.host-right { overflow: auto; scrollbar-width: thin; }
.music-player .note { text-align: right; align-self: center; }
.player.lobby { display: flex; flex-direction: column; align-items: stretch; gap: 16px; min-height: min(540px, 74dvh); text-align: center; }
.player.lobby .player-top { position: relative; flex-direction: column; justify-content: center; width: min(100%, 330px); min-height: 240px; margin: 12px auto; padding: 30px; border: 3px solid #9295a6; border-radius: var(--radius); background: var(--color-surface); }
.player.lobby.ready .player-top { border-color: var(--color-ok); }
.player.lobby.reconnecting .player-top { border-color: #f3a84e; }
.player.lobby.failed .player-top { border-color: var(--color-danger); }
.player.lobby .player-top h2 { width: 100%; margin: 0; }
.player.lobby .player-top .drawn-name { width: 100%; height: 120px; max-height: 120px; }
.player.lobby .player-points { display: flex; align-items: baseline; gap: 6px; }
.player.lobby .player-points p { margin: 0; }
.player.lobby > button:not([hidden]):not(.change-role) { margin-top: auto; background: var(--color-ok); color: #142b22; font-weight: 650; min-height: 52px; }
.player.lobby.ready > button:not([hidden]):not(.change-role) { background: var(--color-surface); color: var(--color-text); }
.shell:has(.join-form):not(.wide) { position: relative; max-width: 540px; gap: 12px; padding: 16px; }
.shell:has(.join-form):not(.wide) header h1 { font-size: 26px; }
.shell:has(.join-form) .slogan { display: none; }
.join-form { gap: 12px; }
.join-form > .row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding-right: 0; }
.join-form > .row button { font-size: 15px; padding: 8px; display: flex; align-items: center; justify-content: center; gap: 8px; }
.join-form .name-editor { margin: 4px 0; gap: 10px; }
.join-form .name-editor h3 { font-size: 17px; }
.join-form .name-width { font-size: 12px; gap: 4px; }
.join-form .name-width-preview { height: 36px; width: 36px; flex-basis: 36px; }
.join-form .name-canvas { height: auto; aspect-ratio: 8 / 3; }
.join-form > .primary { min-height: 48px; }

/* Вход по слову: выбор роли — столбик во всю ширину, как кнопки главной. */
.join-form.picking { margin-block: 0; }
.role-hint { margin: 0; text-align: center; }
.join-form .role-pick { display: grid; grid-template-columns: 1fr; gap: 12px; }
.join-form .role-pick .press { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: clamp(50px, 6.5dvh, 58px); font-size: 16px; font-weight: 800; border-radius: 15px; }
.join-form .role-pick .icon { width: 24px; height: 24px; }
/* Настройка игрока: ровные отступы, смена роли внизу как на TV. */
.player-setup { display: grid; gap: 12px; }
.player-setup > .note { margin: 0; }
.join-form .name-mode .press { display: inline-flex; align-items: center; gap: 8px; }
.join-form .name-mode .icon { width: 20px; height: 20px; }
/* The submit follows its form instead of leaving a viewport-sized void. */
.join-form .join-submit { position: static; width: 100%; min-height: var(--control-height); border-radius: var(--control-radius); }
/* Согласие у кнопки «Войти»: та же формулировка, что в онбординге. */
.join-form .join-legal { margin: 0 0 0; color: #a9a8c7; font-size: 11px; line-height: 1.35; text-align: center; }
.join-form .join-legal a { color: #d8c58f; text-decoration: underline; text-underline-offset: 2px; }
.join-form .join-legal a:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }

.player-mode:has(.player.lobby) .effects-control { position: static; height: 40px; }
.player-settings-button { width: 40px; height: 40px; min-width: 40px; min-height: 40px; padding: 8px; }
.player-settings-button .icon { display: flex; width: 100%; height: 100%; }
.player-settings-button .icon svg { width: 100%; height: 100%; }
.player-exit-button { background: var(--color-danger); color: var(--color-bg); }
.player-exit-button .icon { display: flex; width: 100%; height: 100%; }
.player-exit-button .icon svg { width: 100%; height: 100%; }
.bubble.left { border-color: var(--color-danger); color: var(--color-text); }
.bubble.left .bubble-status, .tv-player.left .connection-state { color: var(--color-danger); }
.bubble.returning .bubble-status, .tv-player.returning .connection-state { color: var(--color-accent); }
.tv-player.left .player-frame { border-color: var(--color-danger); }
.tv-player.returning .player-frame { border-color: var(--color-accent); }
.player-return-status { color: var(--color-accent); font-weight: 650; }
.player-mode > .effects-control { position: static; display: grid; grid-template-columns: minmax(0, 1fr) repeat(3, 44px); align-items: center; gap: 6px; width: 100%; height: auto; min-height: 44px; margin: 0; }
/* Шапка игрока: слева логотип, счёт, пилюля состояния, справа кнопки. */
.player-mode > .effects-control.player-top { grid-template-columns: auto auto minmax(0, 1fr) repeat(2, 44px); }
.player-mode > .effects-control.player-top > .player-actions { display: contents; }
.player-top .player-logo { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; }
.player-top .player-logo img { display: block; width: auto; height: 22px; }
.player-top .player-points { display: flex; align-items: baseline; gap: 4px; }
.player-top .player-points .score { margin: 0; font-size: 20px; line-height: 1; }
.player-top .player-points span { font-size: 10px; color: var(--color-muted); }
/* Пилюля состояния в шапке игрока: переподключение, видео, ход, кот, ошибка. */
.status-pill { display: inline-flex; align-items: center; justify-self: center; gap: 8px; min-width: 0; max-width: 100%; margin: 0; padding: 8px 14px; border: 1px solid color-mix(in srgb, var(--color-muted) 35%, transparent); border-radius: 999px; background: var(--color-surface); color: var(--color-text); font-size: 14px; line-height: 1.2; white-space: nowrap; overflow: hidden; }
.status-pill .icon { flex: none; width: 18px; height: 18px; }
.status-pill .icon svg { display: block; width: 100%; height: 100%; }
.status-pill.is-turn { border-color: var(--color-accent); color: var(--color-accent); font-weight: 700; }
.status-pill.is-error { border-color: var(--color-danger); color: var(--color-danger); font-weight: 700; cursor: pointer; }
button.status-pill { min-height: 0; min-width: 0; touch-action: manipulation; }
.error-advice { color: var(--color-text); }
.error-contact { font-size: 14px; }
.error-contact a { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; }
.error-contact .icon { width: 18px; height: 18px; }
.error-contact .icon svg { display: block; width: 100%; height: 100%; }
/* Логотип-ссылка на главную: кликабелен везде. */
.brand-home { display: inline-flex; border-radius: 8px; }
.brand-home img { display: block; }
a.brand-home { cursor: pointer; }
/* Шапка экрана входа: назад, комната, состав, выбор роли — всё по левому краю. */
.join-head { display: grid; gap: 4px; text-align: left; }
.join-topline { display: flex; align-items: center; gap: 10px; margin: 0; }
.join-back { display: inline-flex; align-items: center; gap: 6px; min-height: 0; min-width: 0; padding: 6px 10px 6px 6px; background: transparent; border: 1px solid transparent; border-radius: 10px; color: var(--color-text); font-size: 15px; font-weight: 600; }
.join-back .icon { width: 20px; height: 20px; }
.join-back .icon svg { display: block; width: 100%; height: 100%; }
.join-room { margin: 0; font-size: 19px; font-weight: 800; }
.join-count { margin: 0; color: var(--color-muted); }
.join-role { margin: 4px 0 0; font-size: 16px; font-weight: 650; }
.player-mode > .effects-control > button { display: grid; place-items: center; box-sizing: border-box; width: 44px; min-width: 44px; height: 44px; min-height: 44px; padding: 6px; line-height: 1; }
.player-mode > .effects-control > button .icon { display: block; flex: none; width: 28px; height: 28px; }
.player-mode > .effects-control > button .icon svg { display: block; width: 100%; height: 100%; }
.player-header-identity { display: flex; align-items: center; gap: 8px; min-width: 0; }
.player-header-identity h2 { flex: 1; min-width: 0; margin: 0; font-size: 16px; line-height: 1.1; overflow-wrap: anywhere; }
.player-header-identity .drawn-name { display: block; width: 100%; height: 40px; max-height: 40px; }
.player-header-identity .player-points { flex: none; text-align: center; }
.player-header-identity .score { margin: 0; font-size: 20px; line-height: 1; }
.player-header-identity .player-points span { font-size: 10px; }
.player-settings-overlay { position: fixed; z-index: 100; inset: 0; display: grid; place-items: center; padding: 20px; background: #080a268c; backdrop-filter: blur(2px); }
.player-settings-modal { width: min(100%, 380px); padding: 22px; border: 1px solid color-mix(in srgb, var(--color-muted) 35%, transparent); border-radius: 20px; background: var(--color-bg); box-shadow: 0 20px 60px #0008; animation: prompt-arrive 160ms ease-out; }

/* Телевизор: доска и карточка вопроса кратко перекрываются на время перехода. */
.tv-board-layer,
.tv-question-layer { position: relative; flex: 1 1 0; min-width: 0; min-height: 0; }
.tv-question-layer { display: flex; flex-direction: column; }
.tv-main { position: relative; }
.tv-board-layer { display: flex; }
.tv-board-layer.overlap,
.tv-question-layer.overlap { position: absolute; inset: 0; flex: none; }
.tv-board-layer.overlap { z-index: 1; }
.tv-question-layer.overlap { z-index: 2; }
.tv-board-layer.overlap.arriving { z-index: 2; background: var(--color-bg); }
.tv-question-layer.overlap.closing { z-index: 0; }
.tv-board-layer[hidden],
.tv-question-layer[hidden] { display: none; }
.tv-board-layer > .game-board { width: 100%; }
.tv-question-layer .question-card { width: 100%; height: 100%; }
.tv-question-layer.opening { animation: tv-transition-clock 540ms linear both; }
.tv-question-layer.closing { animation: tv-transition-clock 240ms linear both; }
.tv-question-layer.opening .question-card { animation: tv-question-enter 360ms cubic-bezier(.2,.75,.25,1) 180ms both; }
.tv-question-layer.closing .question-card { animation: tv-question-leave 180ms cubic-bezier(.4,0,1,1) both; }
.tv-round-start-title {
  position: absolute;
  z-index: 4;
  top: 1rem;
  left: 50%;
  margin: 0;
  padding: .55rem 1rem;
  border: 1px solid color-mix(in srgb, var(--color-accent), transparent 55%);
  border-radius: 999px;
  color: var(--color-text);
  background: color-mix(in srgb, var(--color-bg), transparent 12%);
  font-weight: 700;
  transform: translateX(-50%);
  animation: tv-round-title 900ms ease-out both;
  pointer-events: none;
}
.tv-round-start-title[hidden] { display: none; }
.game-board.tv-board { position: relative; isolation: isolate; overflow: hidden; }
.game-board.tv-board::after {
  content: "";
  position: absolute;
  z-index: 2;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(135deg, transparent 0%, transparent 44%, rgb(255 255 255 / 4%) 47%, rgb(255 255 255 / 18%) 50%, rgb(255 255 255 / 4%) 53%, transparent 56%, transparent 100%);
  mix-blend-mode: screen;
  background-size: 300% 300%;
  background-position: 100% 100%;
  animation: tv-board-glint 16s linear infinite;
}
.game-board.tv-board-leaving::after { opacity: 0; }
.game-board.tv-board .cell { transition: transform 180ms ease, background-color 180ms ease, box-shadow 180ms ease; }
.game-board.tv-board .cell.tv-picked {
  position: relative;
  z-index: 1;
  color: var(--color-text);
  background: color-mix(in srgb, var(--color-board), var(--color-accent) 55%);
  box-shadow: inset 0 0 0 3px var(--color-accent), 0 0 24px color-mix(in srgb, var(--color-accent), transparent 35%);
  animation: tv-cell-picked 220ms ease-out both;
}
.game-board.tv-board-leaving { animation: tv-board-leave 540ms cubic-bezier(.4,0,.8,.3) both; }
.tv-board-layer.arriving > .game-board { animation: tv-board-enter 380ms cubic-bezier(.2,.7,.25,1) both; }
.tv-board-layer.arriving .game-board .cell:not(.used) {
  animation: tv-cell-arrive 220ms ease-out backwards;
  animation-delay: calc(var(--tv-cell-order, 0) * 24ms);
}
.tv-board-layer.round-start-tiles > .game-board {
  animation: tv-grid-reveal 2200ms cubic-bezier(.4,0,.2,1) both;
  -webkit-mask-image: linear-gradient(to bottom, #000 0, #000 max(0px, calc(var(--tv-grid-y) - 50px)), transparent var(--tv-grid-y), transparent 100%);
  mask-image: linear-gradient(to bottom, #000 0, #000 max(0px, calc(var(--tv-grid-y) - 50px)), transparent var(--tv-grid-y), transparent 100%);
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
}
.tv-board-layer.round-start-tiles .theme h2 span { visibility: hidden; }
.tv-board-layer.round-start-tiles .game-board.tv-board::after,
.tv-board-layer.round-start-themes .game-board.tv-board::after,
.tv-board-layer.round-start-prices .game-board.tv-board::after { animation-play-state: paused; }
.tv-board-layer.round-start-themes .theme h2 span {
  animation: tv-theme-drop 520ms cubic-bezier(.2,.7,.25,1) backwards;
  animation-delay: calc(var(--tv-theme-order, 0) * 160ms);
}
.tv-board-layer.round-start-tiles .tv-price,
.tv-board-layer.round-start-themes .tv-price { visibility: hidden; }
.tv-board-layer.round-start-prices .tv-price {
  display: inline-block;
  visibility: visible;
  transform-origin: center;
  animation: tv-price-grow 760ms linear backwards;
  animation-delay: calc(var(--tv-price-order, 0) * 125ms);
}
@keyframes tv-board-glint {
  0%, 74% { background-position: 100% 100%; }
  88% { background-position: 50% 50%; }
  96%, 100% { background-position: 0% 0%; }
}
@keyframes tv-cell-picked {
  from { transform: scale(.94); filter: brightness(1.8); }
  to { transform: scale(1); filter: brightness(1); }
}
@keyframes tv-question-enter {
  from { opacity: 0; transform: scale(.97) translateY(12px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes tv-question-leave {
  from { opacity: 1; transform: scale(1); }
  to { opacity: 0; transform: scale(.97) translateY(-8px); }
}
@keyframes tv-board-enter {
  from { opacity: 0; transform: scale(.985); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes tv-board-leave {
  from { opacity: 1; transform: scale(1); }
  to { opacity: .18; transform: scale(.975); }
}
@keyframes tv-cell-arrive {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: translateY(0); }
}
@property --tv-grid-y {
  syntax: "<length-percentage>";
  inherits: false;
  initial-value: 0px;
}
@keyframes tv-grid-reveal {
  from { --tv-grid-y: 0px; }
  to { --tv-grid-y: calc(100% + 50px); }
}
@keyframes tv-theme-drop {
  0% { opacity: 0; transform: translateY(-100%); }
  72% { opacity: 1; transform: translateY(5%); }
  100% { opacity: 1; transform: translateY(0); }
}
@keyframes tv-price-grow {
  0% { opacity: 0; transform: scale(0); }
  85% { opacity: 1; transform: scale(.78); animation-timing-function: cubic-bezier(.25,.1,.25,1); }
  100% { opacity: 1; transform: scale(1); }
}
@keyframes tv-round-title {
  0% { opacity: 0; transform: translate(-50%, -8px) scale(.96); }
  18%, 72% { opacity: 1; transform: translate(-50%, 0) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -4px) scale(.98); }
}
@keyframes tv-transition-clock { from { opacity: 1; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .game-board.tv-board::after { animation: none; }
  .game-board.tv-board .cell { transition: none; }
  .game-board.tv-board .cell.tv-picked { animation-duration: 1ms; }
  .game-board.tv-board-leaving { animation-duration: 1ms; }
  .tv-question-layer.opening .question-card { animation: tv-question-enter 1ms linear 0s both; }
  .tv-question-layer.closing .question-card { animation: tv-question-leave 1ms linear 0s both; }
  .tv-question-layer.opening,
  .tv-question-layer.closing { animation-duration: 1ms; }
  .tv-board-layer.arriving > .game-board { animation-duration: 1ms; }
  .tv-board-layer.arriving .game-board .cell { animation: none; }
  .tv-board-layer.round-start-tiles > .game-board,
  .tv-board-layer.round-start-themes .theme h2 span,
  .tv-board-layer.round-start-prices .tv-price { animation-duration: 1ms; animation-delay: 0s; }
}
.player-settings-modal .player-settings-action { display: block; width: 100%; height: auto; min-height: 52px; padding: 12px 16px; font-size: 15px; white-space: normal; border: 1px solid color-mix(in srgb, var(--color-muted) 35%, transparent); background: var(--color-surface); color: var(--color-text); font-weight: 600; }
.change-role { margin-top: 12px; font-size: 13px; width: 100%; background: transparent; color: var(--color-muted); }
.player.lobby .change-role { background: transparent; color: var(--color-muted); border: 1px solid color-mix(in srgb, var(--color-muted) 35%, transparent); }

/* Immersive signature entry on touch phones in landscape. The form scrolls below
   the canvas so the green check can reveal the existing submit button. */
html.drawing-landscape:has(.shell:not(.player-mode):not(.tv-mode) .join-form.drawing-active),
html.drawing-landscape:has(.shell:not(.player-mode):not(.tv-mode) .join-form.drawing-active) body { width: 100%; height: 100%; overflow: hidden; }
html.drawing-landscape .shell:not(.player-mode):not(.tv-mode):has(.join-form.drawing-active) {
  position: fixed; inset: 0; z-index: 50; display: block; width: 100vw; height: 100dvh; min-height: 0;
  max-width: none; margin: 0; padding: 0; overflow: auto; overscroll-behavior: contain;
}
html.drawing-landscape .shell:not(.player-mode):not(.tv-mode):has(.join-form.drawing-active) > header,
html.drawing-landscape .shell:not(.player-mode):not(.tv-mode):has(.join-form.drawing-active) > .effects-control { display: none !important; }
html.drawing-landscape .shell:not(.player-mode):not(.tv-mode):has(.join-form.drawing-active) .join-form {
  display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; gap: 8px; width: 100%; max-width: none; min-height: 100%;
}
html.drawing-landscape .shell:not(.player-mode):not(.tv-mode):has(.join-form.drawing-active) .join-form > .row { display: none; }
html.drawing-landscape .name-editor.landscape-drawing {
  box-sizing: border-box; display: block; width: 100%; height: 100dvh; min-height: 0; max-width: none;
  margin: 0;
  padding: calc(10px + env(safe-area-inset-top)) calc(10px + var(--drawing-safe-right, env(safe-area-inset-right))) calc(10px + env(safe-area-inset-bottom)) calc(10px + var(--drawing-safe-left, env(safe-area-inset-left)));
  overflow: hidden;
}
html.drawing-landscape .name-editor.landscape-drawing > h3 { display: none; }
html.drawing-landscape .drawing-workspace {
  display: grid; grid-template-columns: clamp(44px, 6dvh, 64px) minmax(0, 1fr) clamp(32px, 5dvh, 48px) 48px;
  grid-template-rows: minmax(0, 1fr); grid-template-areas: "colors canvas width actions"; align-items: stretch; gap: 8px; width: 100%; height: 100%; min-height: 0;
}
html.drawing-landscape .name-colors {
  grid-column: 1; grid-row: 1; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: repeat(8, minmax(0, 1fr));
  gap: 4px; width: 100%; max-width: none; min-height: 0;
}
html.drawing-landscape .name-swatch { min-height: 0; padding: 2px; }
html.drawing-landscape .name-swatch span { width: min(28px, 5dvh); height: min(28px, 5dvh); }
html.drawing-landscape .name-canvas {
  grid-column: 2; grid-row: 1; width: 100%; height: 100%; min-width: 0; min-height: 0; aspect-ratio: auto; border-radius: 12px;
}
html.drawing-landscape .name-width {
  grid-column: 3; grid-row: 1; display: grid; grid-template-rows: minmax(0, 1fr) 36px; justify-items: center; align-items: center; gap: 4px;
  min-width: 0; min-height: 0;
}
html.drawing-landscape .name-width-control { height: 100%; min-height: 0; flex-direction: column; justify-content: center; gap: 0; }
html.drawing-landscape .name-width-control input { width: 24px; height: 100%; min-height: 0; flex: 1; writing-mode: vertical-lr; direction: rtl; }
html.drawing-landscape .name-width-preview { width: 32px; height: 32px; flex-basis: 32px; }
html.drawing-landscape .drawing-actions {
  grid-column: 4; grid-row: 1; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: repeat(4, minmax(0, 1fr));
  align-items: center; justify-items: center; gap: 6px; min-width: 0; min-height: 0;
}
html.drawing-landscape .drawing-actions .icon-button { width: 44px; min-width: 44px; height: 44px; min-height: 44px; padding: 9px; }
html.drawing-landscape .drawing-actions .erase { margin: 0; background: var(--color-surface); color: var(--color-text); }
html.drawing-landscape .drawing-actions .drawing-done { display: inline-grid; background: var(--color-ok); border-color: var(--color-ok); color: #142b22; }
html.drawing-landscape .shell:not(.player-mode):not(.tv-mode):has(.join-form.drawing-active) .join-form > .primary { width: min(100% - 32px, 480px); justify-self: center; margin: 8px 16px 20px; }
@media (min-width: 900px) and (max-width: 1200px) {
  .shell:has(.host-desk) { --host-col-left: 260px; --host-col-right: 280px; }
  .player-canvas { padding: 22px; gap: 20px; }
  .player-canvas .bubble { padding: 16px; }
  .host-controls > .start-game:not([hidden]) { position: static; transform: none; }
  .host-controls:has(.start-game:not([hidden])) { justify-content: center; }
}
@media (max-width: 899px) {
  .host-library { display: grid; grid-template-columns: minmax(0, 1fr) 150px; }
  .host-library > div:first-child { grid-column: 1 / -1; }
  .host-dock .dock-volume { grid-template-columns: minmax(0, 1fr); }
  .host-dock .dock-effects { display: none; }
  .host-dock .volume-row { grid-template-columns: auto minmax(0, 1fr); }
  .host-dock .volume-row > span { white-space: nowrap; }
  .player-canvas { min-height: 300px; }
}
@media (max-height: 650px) and (max-width: 600px) {
  .shell:has(.join-form):not(.wide) { padding: 10px 14px; gap: 8px; }
  .join-form { gap: 8px; }
  .join-form .name-editor { gap: 6px; }
  .player.lobby { min-height: 70dvh; gap: 10px; }
  .player.lobby .player-top { min-height: 180px; padding: 20px; margin: 0 auto; }
}

/* Весь вопрос можно прочитать и рассмотреть: прокручивается содержимое,
   а кнопка ответа остаётся в нижней зоне и не вытесняет картинку. */
.shell.player-mode:has(.player .buzz:not([hidden])) {
  box-sizing: border-box; display: flex; flex-direction: column;
  height: 100dvh; min-height: 0; max-height: 100dvh; overflow: hidden;
  padding-top: calc(12px + env(safe-area-inset-top));
  padding-bottom: calc(20px + env(safe-area-inset-bottom));
}
.shell.player-mode:has(.player .buzz:not([hidden])) > div:has(.player) {
  display: flex; flex-direction: column; flex: 1; min-height: 0; width: 100%; align-self: stretch;
}
.player-mode .player:has(.buzz:not([hidden])) {
  flex: 1; height: auto; min-height: 0; max-height: 100%; min-width: 0; overflow: visible; gap: 8px;
}
.player-mode .player:has(.buzz:not([hidden])) .player-top { flex: 0 0 auto; }
.player-mode .player:has(.buzz:not([hidden])) .question-card {
  flex: 0 1 auto; min-width: 0; min-height: 0; max-height: none; overflow: hidden;
  padding: 12px; gap: 8px; grid-template-rows: auto minmax(0, 1fr) auto;
}
.player-mode .question-meta { padding-right: 58px; }
.player-mode .player:has(.buzz:not([hidden])) .question-content {
  width: 100%; min-width: 0; min-height: 0; overflow-x: hidden; overflow-y: auto;
  justify-content: flex-start; gap: 8px; overscroll-behavior: contain;
}
.player-mode .player:has(.buzz:not([hidden])) .question-text {
  display: block; overflow: visible; -webkit-line-clamp: unset;
  white-space: pre-wrap; overflow-wrap: anywhere; flex-shrink: 0;
}
.player-mode .player:has(.buzz:not([hidden])) .question-images {
  align-self: stretch; width: calc(100% + 24px); min-width: 0; max-width: none;
  margin-inline: -12px; flex-shrink: 0; overflow: hidden;
}
.player-mode .player:has(.buzz:not([hidden])) .question-image {
  flex: 0 1 100%; width: 100%; min-width: 0; max-width: 100%; height: auto;
  max-height: 45dvh; object-fit: contain;
}
.player-mode .player:has(.buzz:not([hidden])) .question-media video { max-height: 45dvh; }
.player-mode .player:has(.buzz:not([hidden])) .buzz {
  flex: 1 0 25dvh; min-height: max(25dvh, 72px); max-height: none;
  width: 100%; font-size: clamp(28px, 6vw, 40px);
}
.player-mode .player:has(.buzz:not([hidden])):has(.question-with-choices) .question-card { flex: 1 1 0; max-height: none; min-height: 0; }
.player-mode .player:has(.buzz:not([hidden])):has(.question-with-choices) .buzz { flex: 0 0 clamp(72px, 12dvh, 120px); min-height: 72px; }
.player-mode .question-choice { line-height: 1.2; padding-block: .25em; }
.player-mode :is(.question-choices-prompt, .question-image-prompt) { line-height: 1.2; }
.player-mode .player:has(.question-with-choices) .question-choice-media > .question-images { width: 100%; margin: 0; flex-shrink: 1; }
.player-mode .player:has(.question-with-choices) .question-choice-media .question-image { max-height: 100%; }
.holder:empty { display: none; }
html.drawing-landscape .name-colors,
html.drawing-landscape .drawing-actions { position: relative; z-index: 1; }
html.drawing-landscape .name-swatch,
html.drawing-landscape .drawing-actions button { touch-action: manipulation; }

/* Mobile host: status / stage / actions share one viewport. */
@media (max-width: 899px), (max-height: 420px) {
  html:has(.host-desk), body:has(.host-desk) { height: 100%; overflow: hidden; }
  .shell:has(.host-desk) { height: 100dvh; min-height: 0; max-width: none; padding: 0; overflow: hidden; grid-template-rows: minmax(0, 1fr); }
  .shell:has(.host-desk) > .route-page { display: grid; height: 100%; min-height: 0; }
  .shell:has(.host-desk) > .alert { position: fixed; top: 70px; left: 12px; right: 12px; z-index: 45; }
  .host-desk, .host-desk.playing { height: 100%; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto; gap: 0; }
  .host-mobile-bar { position: relative; display: flex; align-items: center; gap: 8px; padding: calc(8px + env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) 8px max(12px, env(safe-area-inset-left)); border-bottom: 1px solid var(--color-surface); }
  .host-mobile-bar .icon-button { flex: none; display: grid; place-items: center; width: 42px; min-width: 42px; height: 42px; min-height: 42px; padding: 0; color: #f4f3ff; background: #303078; border: 1px solid rgba(255,255,255,.045); border-radius: 14px; }
  .host-mobile-bar .icon-button:active { transform: scale(.96); }
  .host-mobile-bar .icon { width: 23px; height: 23px; flex: none; }
  .host-mobile-bar .icon svg { display: block; }
  .mobile-status { flex: 1; min-width: 0; display: grid; gap: 4px; align-content: center; }
  .host-mobile-bar .host-round-title { font-size: 18px; }
  .host-mobile-bar .find-metric { min-height: 28px; padding: 2px 4px 2px 8px; gap: 5px; }
  .host-mobile-bar .find-metric .icon { width: 14px; height: 14px; }
  .host-mobile-bar .find-metric-label { font-size: 10px; letter-spacing: .04em; }
  .host-mobile-bar .find-metric b { min-width: 22px; padding: 1px 6px; font-size: 13px; }
  .host-center { grid-row: 2; min-height: 0; padding: 12px 12px 0; overflow: hidden; }
  .host-stage, .host-lobby { min-height: 0; overflow: hidden; gap: 8px; }
  .host-lobby { display: grid; grid-template-rows: max-content max-content minmax(120px, 1fr); gap: 8px; overflow-y: auto; scrollbar-width: thin; }
  .players-head { display: flex; align-items: center; gap: 9px; margin: 2px 4px 0; }
  .players-head h2 { margin: 0; font-size: 18px; font-weight: 800; letter-spacing: -.3px; }
  .players-count { font-size: 10px; font-weight: 850; background: #313275; color: #d0d3fd; border-radius: 9px; padding: 5px 8px; white-space: nowrap; }
  .mobile-host-invite { display: grid; gap: 0; min-height: 0; padding: 15px; border-radius: 24px; border: 1px solid rgba(191, 194, 255, .16); background: linear-gradient(135deg, #292970 0%, #212360 63%, #1d205b 100%); box-shadow: 0 13px 30px rgba(4, 6, 31, .15), inset 0 1px rgba(255,255,255,.03); }
  .card-kicker { display: flex; align-items: center; gap: 7px; color: #c2c4ec; font-size: 9px; letter-spacing: 1.65px; font-weight: 850; margin-bottom: 12px; }
  .kicker-line { display: inline-block; width: 14px; height: 2px; border-radius: 10px; background: #ffda78; }
  .signal-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #64e2a0; box-shadow: 0 0 0 3px rgba(100,226,160,.12); }
  .invite-grid { display: grid; grid-template-columns: clamp(110px, 32vw, 137px) minmax(0, 1fr); align-items: center; gap: 14px; }
  .qr-frame { display: grid; place-items: center; width: 100%; aspect-ratio: 1; padding: 8px; background: #fff; border-radius: 17px; box-shadow: 0 4px 0 rgba(7, 10, 42, .18); }
  .qr-frame .qr { display: block; width: 100%; height: 100%; }
  .invite-details { min-width: 0; display: grid; align-content: start; }
  .invite-details h1 { font-size: 22px; letter-spacing: -.5px; margin: 0 0 5px; font-weight: 850; line-height: 1.13; }
  .invite-details p { color: #c2c3de; font-size: 11px; line-height: 1.4; margin: 0 0 10px; }
  .small-label { display: block; margin-bottom: 5px; font-size: 9px; letter-spacing: 1.3px; font-weight: 850; color: #b5b6d4; }
  .word-button { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; min-height: 37px; padding: 0 9px; border: 1px solid rgba(255,218,120,.55); border-radius: 11px; color: #ffda78; background: #27245e; cursor: pointer; }
  .word-button strong { font-size: 16px; font-weight: 900; letter-spacing: 1.8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .word-button .icon { flex: none; width: 16px; height: 16px; opacity: .9; }
  .share-button { display: flex; align-items: center; justify-content: center; gap: 7px; width: 100%; min-height: 0; margin-top: 7px; padding: 7px 5px; border: 0; background: transparent; color: #deddfa; font-size: 11px; font-weight: 700; cursor: pointer; }
  .share-button .icon { width: 14px; height: 14px; }
  .mobile-host-invite > .note { margin: 8px 0 0; text-align: center; font-size: 11px; }
  .mobile-host-invite > .note:empty { display: none; }
  .host-lobby .player-canvas { min-height: 0; padding: 4px; gap: 6px; grid-auto-rows: minmax(0, 1fr); align-content: stretch; overflow: hidden; }
  .host-lobby .bubble { width: 100%; padding: 8px 34px 8px 8px; aspect-ratio: auto; height: 100%; max-height: none; border-radius: 14px; gap: 3px; }
  .host-lobby .bubble .drawn-name { max-height: 56px; }
  .host-lobby .bubble-remove { inset: 4px 4px auto auto; width: 28px; min-width: 28px; height: 28px; min-height: 28px; }
  .host-lobby .bubble-remove svg { width: 14px; height: 14px; }
  .host-lobby .canvas-empty { font-size: 15px; padding: 24px; margin: 0; }
  .host-board { --board-gap: 5px; min-width: 0; width: 100%; height: 100%; flex: 1; grid-template-columns: minmax(0, 1fr); grid-template-rows: repeat(var(--columns), minmax(0, 1fr)); }
  .host-board .theme { display: grid; grid-template-columns: minmax(88px, 1.8fr) minmax(0, 5fr); container-type: normal; gap: 5px; }
  .host-board .theme h2 { margin: 0; padding: 6px; font-size: clamp(11px, 2.8vw, 16px); line-height: 1.2; border-radius: 8px; overflow: hidden; }
  .host-board .cells { display: grid; grid-template-columns: repeat(var(--rows), minmax(0, 1fr)); grid-template-rows: minmax(0, 1fr); container-type: normal; }
  .host-board .cell { min-height: 0; padding: 0; font-size: clamp(13px, 3.7vw, 22px); border-radius: 8px; }
  .host-dock { position: static; grid-row: 3; display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; min-height: 0; background: rgba(22, 23, 70, .95); border-top: 1px solid rgba(172, 176, 242, .13); padding: 12px 12px calc(13px + env(safe-area-inset-bottom)); }
  .host-dock > .host-status, .host-dock > .dock-volume { display: none; }
  .host-controls { grid-row: auto; grid-column: auto; justify-content: stretch; gap: 6px; }
  .host-controls > .row { display: contents; }
  .host-controls button, .host-controls summary { min-height: 44px; font-size: 12px; padding: 8px; }
  .host-controls .start-game { position: relative; min-width: 0; flex: 1 1 auto; width: 100%; min-height: 56px; padding: 8px 20px; font-size: 16px; font-weight: 900; letter-spacing: .15px; text-transform: uppercase; justify-content: center; gap: 11px; border: 0; border-radius: 16px; background: #62e39f; color: #21254e; box-shadow: inset 0 1px rgba(255,255,255,.3), 0 5px 0 rgba(5,14,40,.15); }
  .host-controls .start-game:hover { filter: brightness(1.07); }
  .host-controls .start-game:active { transform: scale(.99); }
  .host-controls .start-game .icon { width: 22px; height: 22px; }
  .host-controls .start-game .start-arrow { position: absolute; right: 15px; display: inline-flex; opacity: .62; }
  .host-controls .start-game .start-arrow .icon { width: 18px; height: 18px; }
  .host-controls:has(.start-game:not([hidden])) { justify-content: center; }
  .host-controls .host-turn-tools > .room-reset { display: none; }
  .host-controls .picker-menu[hidden] { display: none; }
  .host-controls .picker-menu { flex: 1; }
  .host-controls .picker-menu summary { width: 100%; justify-content: center; }
  .host-mobile-bar .mobile-assistant { display: inline-flex; flex: none; align-items: center; justify-content: center; width: 36px; min-width: 36px; height: 36px; min-height: 36px; padding: 7px; }
  .host-mobile-bar .mobile-assistant > span:not(.icon) { display: none; }
  .host-mobile-bar .mobile-assistant svg { width: 22px; height: 22px; }
  .host-panel-backdrop { display: block; position: fixed; inset: 0; z-index: 30; background: #0009; border: 0; border-radius: 0; padding: 0; }
  .host-library, .host-right, .host-settings { display: none; }
  .host-library.mobile-panel-open, .host-right.mobile-panel-open, .host-settings.mobile-panel-open { position: fixed; display: flex; flex-direction: column; z-index: 35; gap: 18px; min-height: 0; min-width: 0; border: 1px solid var(--color-surface); background: var(--color-bg); padding: 16px; overflow: auto; }
  .host-library.mobile-panel-open { inset: 0 auto 0 0; width: min(360px, calc(100vw - 24px)); padding-top: calc(12px + env(safe-area-inset-top)); padding-bottom: calc(16px + env(safe-area-inset-bottom)); border-radius: 0 20px 20px 0; }
  .host-right.mobile-panel-open, .host-settings.mobile-panel-open { inset: auto 12px calc(12px + env(safe-area-inset-bottom)); max-height: calc(100dvh - 32px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); border-radius: 22px; box-shadow: 0 16px 60px #0008; }
  .mobile-panel-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex: none; }
  .mobile-panel-heading h2 { font-size: 18px; margin: 0; }
  .mobile-panel-close { flex: none; }
  .desktop-host-format, .host-right.mobile-panel-open > .music-player, .host-right.mobile-panel-open > div:not(.mobile-panel-heading) { display: none; }
  .host-library .pack-chooser { max-height: none; flex: none; margin: 0; overflow: visible; }
  .host-library .invitation { width: 100%; }
  .host-library .invitation .qr { width: min(100%, 22dvh); }
  .host-right .prompter { min-height: 240px; }
  .host-right .prompter-feed { max-height: none; }
  .host-right .final-judges { max-height: none; }
  .host-settings .game-format, .host-settings .sound-panel { margin: 0; }
  .host-settings h2 { font-size: 17px; }
  .host-settings .note { font-size: 12px; }
  .host-settings .row { gap: 6px; }
  .host-settings button { font-size: 13px; }
  .host-settings .dock-volume { grid-column: auto; grid-template-columns: 44px minmax(0, 1fr); }
  .host-stage .question-card { padding: 14px; gap: 8px; overflow: visible; }
  .host-stage .host-question { overflow: visible; }
  .host-stage .question-content { min-width: 0; min-height: 0; }
  .host-stage .question-text { font-size: clamp(18px, 4.8vw, 28px); }
  .host-stage .question-image { max-height: 28dvh; }
  .host-stage .question-meta, .host-stage .holder, .host-stage .answer { margin: 0; }
  .host-stage .answer { font-size: 16px; }
}
@media (max-width: 899px) and (max-height: 580px) and (orientation: landscape) {
  .host-mobile-bar { padding-block: 4px; }
  .host-center { padding: 6px 12px; }
  .host-dock { padding-top: 5px; padding-bottom: calc(5px + env(safe-area-inset-bottom)); }
  .host-board { --board-gap: 3px; }
  .host-board .theme { grid-template-columns: minmax(130px, 2fr) minmax(0, 5fr); }
  .host-board .theme h2 { font-size: 11px; padding: 2px 8px; }
  .host-board .cell { font-size: 16px; }
}

.host-question-actions { display: none; }
.host-answer-panel { padding: 12px 0 0; border-top: 1px solid #ffffff30; display: grid; gap: 6px; }
.host-section-label { display: block; font-size: 12px; font-weight: 600; letter-spacing: .04em; color: #ffffffb8; }
.host-answer-panel .answer { margin: 0; font-size: clamp(18px, 2vw, 28px); }
.host-answer-panel .holder { margin: 0; }
/* Пульт ведущего: компактный залитый таймер и ограниченные размеры медиа. */
.host-question .answer-timer { --timer-size: clamp(40px, min(5vw, 8vh), 64px); width: var(--timer-size); height: var(--timer-size); border-radius: 50%; background: #f5c542; color: #211b34; box-shadow: 0 3px 14px #0004; }
.host-question .answer-timer svg { display: none; }
.host-question .answer-timer.urgent { background: #f06467; color: #fff; }
.host-question .answer-timer .timer-digits { font-size: clamp(12px, calc(var(--timer-size) * .28), 18px); }
.host-question .question-content { min-width: 0; min-height: 0; grid-row: 2; overflow: visible; }
.host-question:not(.answer-timer-active) .question-meta { min-height: 0; padding-right: 0; }
.host-question .host-answer-panel { grid-row: 3; }
.host-question .host-question-actions { grid-row: 4; align-self: end; }
.host-question > .topic-strip { grid-row: 5; }
.host-question .question-content > * { min-width: 0; max-width: 100%; flex-shrink: 1; }
.host-question .question-content .question-image { width: auto; max-width: 100%; max-height: min(32dvh, 280px); object-fit: contain; }
.host-question .question-content :is(audio, video, iframe, .external-video) { max-width: 100%; }
.host-question .question-content audio { width: min(100%, 420px); }
.host-question .question-content .question-choice-list { width: 100%; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; }
.host-question .question-content .question-choice { min-width: 0; padding: .25em .4em; font-size: clamp(12px, 1.15vw, 16px); }
.host-question .question-image-options { display: flex; flex: 1 1 0; flex-direction: column; min-height: 0; gap: 4px; }
.host-question .question-image-options .question-choice-list { flex: 1 1 0; min-height: 0; grid-auto-rows: minmax(0, 1fr); gap: 4px; }
.host-question .question-image-options .question-choice-option-image { height: min(14dvh, 80px); min-height: 0; }
@media (max-width: 899px) {
  .host-stage .host-question { flex: 1 1 0; height: 100%; min-height: 0; align-content: start; grid-template-rows: auto minmax(0, 1fr) auto auto auto; padding: clamp(8px, 2vw, 14px); gap: clamp(4px, 1vh, 8px); }
  .host-question .question-meta { padding-right: 56px; min-height: 42px; align-items: flex-start; justify-content: flex-start; text-align: left; }
  .host-question .question-content { grid-row: 2; min-height: 0; justify-content: flex-start; align-content: start; gap: 4px; padding-top: 0; overflow: visible; }
  .host-question .host-section-label { text-align: left; }
  .host-question .host-answer-panel { grid-row: 3; text-align: left; padding-top: 4px; max-height: none; overflow: visible; align-content: start; }
  .host-question .host-answer-panel .holder { font-size: 14px; }
  .host-question .host-answer-panel .answer { margin: 0; font-size: 16px; }
  .host-question .host-answer-panel .answer-explanation { font-size: 12px; line-height: 1.2; }
  .host-question .host-answer-panel .answer-blocks { align-items: flex-start; gap: 4px; }
  .host-question .host-answer-panel .answer-blocks audio { width: min(100%, 280px); height: 32px; min-height: 32px; }
  .host-question .host-question-actions { grid-row: 4; display: block; min-width: 0; align-self: end; padding-top: 4px; border-top: 1px solid #ffffff30; }
  .host-controls > .judge-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-column: 1 / -1; width: 100%; gap: 6px; }
  .host-controls > .judge-actions button { min-width: 0; width: 100%; padding-inline: 6px; }
  .host-question-actions button { min-width: 0; min-height: 42px; width: 100%; padding: 7px 9px; font-size: clamp(12px, 3.5vw, 16px); gap: 6px; }
  .host-question-actions .final-judges { max-height: 24dvh; overflow: auto; }
  .host-question-actions .final-judge > .row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .host-question > .topic-strip { grid-row: 5; }
  .host-right .final-judges { display: none; }
  .host-dock { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .host-dock .host-controls { grid-column: 1; grid-row: 1; }
  .host-controls .host-turn-tools { display: contents; }
  .host-controls .host-turn-tools > button:not([hidden]):not(.room-reset) { min-width: 0; width: 100%; flex: none; justify-content: center; text-align: center; }
  .host-controls .host-turn-tools button { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; line-height: 1.15; }
  .mobile-assistant .icon { display: inline-flex; }
}
@media (max-width: 899px) and (max-height: 580px) and (orientation: landscape) {
  .host-stage .host-question { padding: 8px; gap: 4px; align-content: start; grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr); grid-template-rows: auto minmax(0, 1fr) auto auto; overflow: visible; }
  .host-question .question-meta { grid-column: 1 / -1; min-height: 34px; padding-right: 48px; font-size: 14px; }
  .host-question .timer-wrap { top: 10px; right: 10px; }
  .host-question .answer-timer { --timer-size: clamp(36px, 8vh, 48px); }
  .host-question .question-content { grid-column: 1; grid-row: 2; padding: 0; gap: 4px; }
  .host-question .question-content .question-image { max-height: 24dvh; }
  .host-question .question-text { font-size: clamp(14px, 2.2vw, 19px); }
  .host-question .host-answer-panel { grid-column: 2; grid-row: 2; align-content: start; min-height: 0; max-height: none; overflow: visible; padding: 4px 0 0 8px; border-top: 0; border-left: 1px solid #ffffff30; gap: 4px; }
  .host-question .host-answer-panel .holder { font-size: 12px; }
  .host-question .host-answer-panel > .host-section-label { display: none; }
  .host-question .host-answer-panel .answer { font-size: clamp(14px, 2vw, 20px); }
  .host-question .host-answer-panel .drawn-name { width: 60px; }
  .host-question .host-question-actions { grid-column: 1 / -1; grid-row: 3; padding-top: 3px; }
  .host-controls > .judge-actions { gap: 4px; }
  .host-controls > .judge-actions button { min-height: 30px; padding: 3px 4px; font-size: 11px; }
  .host-question-actions button { min-height: 30px; padding: 3px 6px; font-size: 11px; }
  .host-question-actions .final-judges { max-height: 12dvh; }
  .host-question > .topic-strip { grid-column: 1 / -1; grid-row: 4; }
  .host-lobby { grid-template-rows: max-content max-content minmax(0, 1fr); gap: 3px; }
  .host-lobby .mobile-host-invite { display: flex; flex-direction: row; justify-content: flex-end; min-height: 32px; height: auto; padding: 0; }
  .host-lobby .mobile-host-invite :is(.card-kicker,.qr-frame,.invite-details h1,.invite-details p,.small-label,.share-button) { display: none; }
  .host-lobby .mobile-host-invite .invite-grid { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .host-lobby .mobile-host-qr { display: none; }
  .host-lobby .share-invite { width: auto; min-height: 30px; height: 30px; padding: 4px 12px; font-size: 12px; }
  .host-lobby .player-canvas { height: 100%; min-height: 0; grid-template-columns: repeat(6, minmax(0, 1fr)); grid-template-rows: minmax(0, 1fr); grid-auto-rows: unset; gap: 3px; padding: 1px; }
  .host-lobby .bubble { min-width: 0; min-height: 0; padding: 4px 26px 4px 4px; border-radius: 10px; overflow: hidden; }
  .host-lobby .bubble .drawn-name { max-height: 28px; }
  .host-lobby .bubble.tv-seat > :first-child { display: block; width: calc(100% - 22px); max-width: calc(100% - 22px); max-height: 28px; align-self: center; overflow: visible; text-overflow: clip; white-space: normal; font-size: 10px; }
  .host-lobby .bubble-status { font-size: 9px; }
  .host-lobby .bubble-remove { inset: 3px 3px auto auto; width: 24px; min-width: 24px; height: 24px; min-height: 24px; }
  .host-controls { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); align-items: stretch; width: 100%; gap: 5px; }
  .host-controls .host-turn-tools { display: contents; }
  .host-controls .host-turn-tools > button:not([hidden]):not(.room-reset) { min-width: 0; width: 100%; padding: 4px 6px; font-size: 10px; justify-content: center; text-align: center; }
  .host-controls .picker-menu { min-width: 0; width: 100%; }
  .host-controls .picker-menu summary { min-width: 0; width: 100%; padding-inline: 6px; font-size: 11px; justify-content: center; }
  .host-controls > .start-game:not([hidden]) { justify-self: stretch; }
  .host-dock { padding: 2px 8px calc(2px + env(safe-area-inset-bottom)); }
  .host-controls .host-turn-tools > button:not([hidden]):not(.room-reset) { min-height: 30px; padding-block: 3px; }
  .host-controls .picker-menu summary { min-height: 30px; padding-block: 3px; }
  .host-mobile-bar .icon-button { padding: 4px; }
  .host-mobile-bar .icon { width: 20px; height: 20px; }
  .host-mobile-bar .mobile-assistant svg { width: 20px; height: 20px; }
  .host-controls .host-turn-tools button { line-height: 1.1; }
  .host-mobile-bar { gap: 6px; padding-block: 2px; }
  .host-mobile-bar > .icon-button, .host-mobile-bar > .mobile-assistant { width: 32px; min-width: 32px; height: 32px; min-height: 32px; }
  .host-lobby .bubble-status { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .host-mobile-bar .host-header-reveal { display: -webkit-box; flex: 0 1 min(34vw, 220px); width: auto; min-width: 0; max-width: min(34vw, 220px); max-height: 2.4em; margin: 0; padding: 0; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; border: 0; border-radius: 0; background: transparent; font-size: clamp(10px, 1.8vh, 13px); line-height: 1.2; overflow-wrap: anywhere; }
  .host-stage > .reveal { display: none; }
}
@media (max-width: 899px) and (orientation: portrait) {
  .host-lobby { grid-template-rows: max-content max-content minmax(120px, 1fr); }
  .host-lobby .player-canvas { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(3, minmax(0, 1fr)); grid-auto-rows: unset; }
}
@media (min-width: 900px) and (max-width: 1199px) and (max-height: 580px) and (orientation: landscape) {
  /* Tablet CSS viewport: keep the desktop desk and invitation QR, with a compact roster. */
  .shell:has(.host-desk) { --host-col-left: 190px; --host-col-right: 200px; --host-col-gap: 10px; }
  .host-library { gap: 8px; padding-right: 8px; }
  .host-library .invitation { gap: 4px; }
  .host-library .invitation .qr { width: 120px; }
  .host-right { gap: 8px; }
  .host-right .sound-panel:not(.music-player) { gap: 5px; padding-bottom: 6px; }
  .host-right .sound-panel h2, .host-right .music-player h2, .host-right .prompter h2 { font-size: 14px; line-height: 1.2; }
  .host-right .sound-panel:not(.music-player) > .note { display: none; }
  .host-right .sound-panel .row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; }
  .host-right .sound-panel .row button { min-width: 0; min-height: 32px; padding: 4px 5px; font-size: 10px; line-height: 1.15; }
  .host-right .prompter { min-height: 0; gap: 5px; padding-left: 8px; }
  .host-right .prompter-feed { gap: 4px; }
  .host-right .prompter-line { font-size: 11px; line-height: 1.3; }
  .host-right .prompter-line.spoken { font-size: clamp(13px, 1.4vw, 16px); line-height: 1.3; }
  .host-lobby { gap: 8px; }
  .host-lobby .player-canvas { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: repeat(2, minmax(80px, 130px)); grid-auto-rows: unset; align-content: center; gap: 8px; padding: 8px; overflow: hidden; }
  .host-lobby .bubble { width: 100%; height: 100%; min-height: 0; max-height: none; padding: 8px 34px 8px 8px; aspect-ratio: auto; }
  .host-lobby .bubble .drawn-name { max-height: 60px; }
}
@media (min-width: 1200px) and (orientation: landscape) {
  .host-stage .host-question { align-content: start; grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr); grid-template-rows: auto minmax(0, 1fr) auto auto; }
  .host-question .question-meta { grid-column: 1 / -1; }
  .host-question .question-content { grid-column: 1; grid-row: 2; }
  .host-question .host-answer-panel { grid-column: 2; grid-row: 2; align-content: start; min-height: 0; padding: 4px 0 0 12px; border-top: 0; border-left: 1px solid #ffffff30; }
  .host-question .host-question-actions { grid-column: 2; grid-row: 3; }
  .host-question > .topic-strip { grid-column: 1 / -1; grid-row: 4; }
}
@media (max-width: 600px) and (orientation: portrait) {
  .host-controls { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: stretch; gap: 6px; }
  .host-controls .host-turn-tools { display: contents; }
  .host-controls > .start-game:not([hidden]) { grid-column: 1 / -1; justify-self: stretch; }
  .host-controls .picker-menu { min-width: 0; width: 100%; flex: none; }
  .host-controls .picker-menu summary { width: 100%; justify-content: center; }
  .host-controls .host-turn-tools > button:not([hidden]):not(.room-reset) { min-width: 0; width: 100%; justify-content: center; text-align: center; }
}

/* ── Сводка пака и каталог (docs/plans/pack-library.md, этап 3) ── */
.game-summary { display: grid; gap: 12px; align-content: start; flex: 1 1 auto; min-height: 120px; overflow-y: auto; scrollbar-width: thin; }
.host-library > :not(.game-summary) { flex: none; }
.game-summary h2 { margin: 0; font-size: 17px; }
.summary-head { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 12px; align-items: start; }
.summary-cover { width: 64px; height: 64px; border-radius: 10px; object-fit: cover; background: var(--color-surface); }
.cover-fallback { display: grid; place-items: center; font-weight: 700; color: var(--color-muted); background: var(--color-surface); border-radius: 8px; }
.summary-title { display: grid; gap: 2px; min-width: 0; }
.summary-name { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.25; font-size: 15px; }
.summary-authors { font-size: 12px; color: var(--color-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.summary-authors:empty, .summary-topic-labels:empty { display: none; }
.summary-topic-labels { display: flex; flex-wrap: wrap; gap: 4px; }
.pc-copy { font-size: 11px; color: var(--color-muted); }
.summary-labels-more { cursor: help; }
.summary-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.chip { font-size: 11px; padding: 2px 8px; border-radius: 999px; background: var(--color-surface); color: var(--color-muted); }
.chip.level-chip.plain { color: var(--color-muted); background: var(--color-surface); }
.chip-adult, .badge-adult { color: var(--color-danger); border: 1px solid currentColor; background: transparent; }
.summary-media { padding: 2px 0; }
.summary-media .legend { font-size: 11px; gap: 2px 10px; }
.summary-plan { margin: 0; font-size: 12px; color: var(--color-muted); }
.summary-rounds summary { cursor: pointer; font-size: 12px; color: var(--color-muted); margin-bottom: 6px; }
.summary-rounds .rounds-body { display: grid; gap: 10px; max-height: 40dvh; overflow-y: auto; scrollbar-width: thin; padding-right: 4px; }
.summary-round { display: grid; gap: 4px; }
.summary-rounds h3 { display: flex; align-items: center; gap: 6px; margin: 0; font-size: 12px; color: var(--color-text); font-weight: 600; }
.round-no { display: inline-grid; place-items: center; flex: none; width: 18px; height: 18px; border-radius: 5px; background: var(--color-surface); color: var(--color-accent); font-size: 11px; font-weight: 700; }
.summary-rounds ul { display: grid; gap: 1px; margin: 0; padding: 0 0 0 8px; margin-left: 8px; border-left: 2px solid var(--color-surface); list-style: none; font-size: 12px; line-height: 1.45; color: var(--color-muted); }
.summary-round.final ul { border-left-color: color-mix(in srgb, var(--color-accent) 45%, transparent); }
.summary-rounds li { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.summary-actions { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; position: sticky; bottom: 0; padding-top: 6px; background: var(--color-bg); }
.summary-actions .change-pack { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; }
.summary-actions .icon-button { width: 44px; }
/* Compact pack summary: each round is a separate, keyboard-operable card. */
.game-summary .summary-head { padding: 12px; border: 1px solid #ffffff14; border-radius: 14px; background: var(--color-surface); grid-template-columns: 52px minmax(0, 1fr); gap: 10px; align-items: center; }
.game-summary .summary-cover { width: 52px; height: 52px; border-radius: 8px; }
.game-summary .summary-title { gap: 6px; }
.game-summary .summary-chips { margin: 0; }
.game-summary .summary-chips .chip { background: var(--color-bg); }
.game-summary .summary-plan { line-height: 1.45; }
.game-summary .summary-rounds { flex: none; min-height: 0; overflow: visible; }
.game-summary .summary-rounds .rounds-body { gap: 8px; max-height: none; padding: 0; overflow: visible; }
.game-summary .summary-round { display: block; border: 1px solid #ffffff18; border-radius: 12px; background: var(--color-surface); overflow: hidden; }
.game-summary .summary-round > summary { display: flex; align-items: center; gap: 8px; min-height: 42px; padding: 8px 10px; margin: 0; list-style: none; color: var(--color-text); }
.game-summary .summary-round > summary::-webkit-details-marker { display: none; }
.game-summary .summary-round > summary:focus-visible { outline: 2px solid var(--color-accent); outline-offset: -3px; border-radius: 11px; }
.game-summary .summary-round > summary:hover { background: #ffffff08; }
.game-summary .summary-round h3 { flex: 1; min-width: 0; font-size: 13px; line-height: 1.3; overflow-wrap: anywhere; }
.game-summary .summary-round .round-no { width: 24px; height: 24px; border-radius: 7px; background: var(--color-bg); font-size: 12px; }
.game-summary .round-theme-count { flex: none; padding: 3px 6px; border-radius: 6px; background: var(--color-bg); color: var(--color-muted); font-size: 11px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.game-summary .round-chevron { flex: none; width: 7px; height: 7px; margin: 0 3px 3px 1px; border-right: 1.5px solid var(--color-muted); border-bottom: 1.5px solid var(--color-muted); transform: rotate(45deg); }
.game-summary .summary-round[open] .round-chevron { transform: rotate(225deg); margin-top: 6px; }
.game-summary .summary-round ul { gap: 4px; margin: 0; padding: 0 10px 10px; border: 0; }
.game-summary .summary-round li { overflow: visible; white-space: normal; }
.game-summary .summary-round .summary-theme { display: flex; align-items: center; gap: 8px; padding: 7px 8px; min-height: 32px; border-radius: 7px; font-size: 12px; line-height: 1.4; white-space: normal; overflow: visible; }
.game-summary .summary-theme::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--color-accent); flex: none; }
.game-summary .summary-theme.theme-off::before { background: var(--color-muted); opacity: .5; }
.game-summary .summary-theme .theme-name { overflow-wrap: anywhere; }
.game-summary .summary-round.final .round-no { color: var(--color-accent); }
.game-summary .summary-round.final { border-color: color-mix(in srgb, var(--color-accent) 25%, transparent); }
.desktop-hidden { display: none; }
.pack-job { display: grid; gap: 6px; padding: 8px; border-radius: 8px; background: var(--color-surface); }
.pack-job .job-text { margin: 0; font-size: 12px; }
.pack-empty { display: grid; gap: 8px; padding: 8px; border-radius: 8px; background: var(--color-surface); }
.pack-empty .job-text { margin: 0; font-size: 12px; }
.pack-job.ready .job-text { color: var(--color-ok); }
.pack-job.failed .job-text { color: var(--color-danger); }
.pack-job .job-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.pack-job .job-actions button { font-size: 12px; padding: 6px 4px; }
.progress { height: 4px; border-radius: 2px; background: var(--color-bg); overflow: hidden; }
.progress .bar { height: 100%; border-radius: 2px; background: var(--color-accent); transition: width 300ms linear; }
@keyframes progress-slide { from { transform: translateX(-100%); } to { transform: translateX(340%); } }
.progress.indeterminate .bar { animation: progress-slide 1.2s linear infinite; }
@media (prefers-reduced-motion: reduce) { .progress.indeterminate .bar { animation: none; } }
.link-button { justify-self: start; padding: 0; border: 0; background: none; color: var(--color-accent); font: inherit; font-size: 12px; text-decoration: underline; cursor: pointer; }
.link-button:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
.muted { color: var(--color-muted); }

.library { display: flex; flex-direction: column; gap: 12px; min-height: 0; height: 100%; overflow-y: auto; scrollbar-width: thin; }
.library[hidden], .library [hidden] { display: none; }
.library-bar { position: sticky; top: 0; z-index: 2; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding-bottom: 8px; background: var(--color-bg); }
.library-bar h2 { margin: 0; font-size: 20px; }
.library-bar .search { display: flex; align-items: center; gap: 6px; flex: 1 1 220px; min-width: 160px; padding: 0 10px; border: 1px solid var(--color-surface); border-radius: 8px; background: var(--color-surface); }
.library-bar .search input { flex: 1; min-width: 0; border: 0; background: transparent; color: inherit; font: inherit; padding: 10px 0; outline: none; }
.library-bar .search:focus-within { outline: 2px solid var(--color-accent); }
.library-bar .sort { min-height: 44px; border-radius: 8px; border: 1px solid var(--color-surface); background: var(--color-surface); color: inherit; font: inherit; padding: 0 8px; }
.filters-toggle { display: inline-flex; align-items: center; gap: 6px; }
.filters-toggle[aria-expanded="true"] { border-color: var(--color-accent); color: var(--color-accent); }
.filters-toggle .count { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--color-accent); color: var(--color-bg); font-size: 11px; font-weight: 700; }
.topic-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-button { flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--color-surface); background: var(--color-surface); color: var(--color-muted); font: inherit; font-size: 12px; cursor: pointer; }
.chip-button .dot { width: 8px; height: 8px; border-radius: 50%; }
.chip-button .n { color: var(--color-muted); opacity: .7; font-size: 11px; }
.chip-button:hover { color: var(--color-text); }
.chip-button[aria-pressed="true"] { border-color: var(--color-accent); color: var(--color-accent); background: color-mix(in srgb, var(--color-accent) 10%, var(--color-surface)); }
.chip-button:focus-visible, .pack-card:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
.library-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; }
.library-body.with-filters { grid-template-columns: 250px minmax(0, 1fr); }

/* Фильтры: чипы-переключатели поверх настоящих input, чтобы работали клавиатура и скринридер. */
.library-filters { display: grid; gap: 16px; align-content: start; position: sticky; top: 64px; max-height: calc(100dvh - 210px); overflow-y: auto; scrollbar-width: thin; padding: 14px; border-radius: 14px; background: var(--color-surface); font-size: 12px; }
.library-filters fieldset { display: grid; gap: 6px; margin: 0; padding: 0; border: 0; min-width: 0; }
.library-filters label { min-width: 0; }
.library-filters select { width: 100%; min-width: 0; max-width: 100%; min-height: 36px; padding: 6px 10px; border: 1px solid color-mix(in srgb, var(--color-muted) 22%, transparent); border-radius: 8px; background: var(--color-bg); color: inherit; font: inherit; }
.library-filters .note { white-space: normal; overflow-wrap: anywhere; }
.pc-topic-labels { display: flex; flex-wrap: wrap; gap: 4px; min-width: 0; max-height: 64px; overflow: hidden; }
.pc-topic-labels.is-open { max-height: none; }
.pc-more { padding: 2px 0; border: 0; background: none; color: var(--color-accent); font-size: 11px; cursor: pointer; }
.pc-more:hover { text-decoration: underline; }
.pc-topic-labels:empty { display: none; }
.tchip.topic-tchip { color: var(--topic-color); border-color: color-mix(in srgb, var(--topic-color) 45%, transparent); }
.badge.topic-label { color: var(--topic-color); border: 1px solid color-mix(in srgb, var(--topic-color) 55%, transparent); background: color-mix(in srgb, var(--topic-color) 12%, transparent); }
.pc-topic-labels:not(:empty) { flex-basis: 100%; }
.tag-filter .tchips:empty { display: none; }
.library-filters legend { padding: 0; margin-bottom: 6px; font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--color-muted); }
.tchips { display: flex; flex-wrap: wrap; gap: 6px; }
.tchips.segmented { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 2px; padding: 2px; border-radius: 10px; background: var(--color-bg); }
.tchip { position: relative; display: inline-flex; align-items: center; gap: 6px; min-height: 30px; padding: 4px 10px; border-radius: 999px; border: 1px solid color-mix(in srgb, var(--color-muted) 22%, transparent); color: var(--color-muted); cursor: pointer; user-select: none; transition: background-color 120ms, color 120ms, border-color 120ms; }
.tchip:hover { color: var(--color-text); border-color: color-mix(in srgb, var(--color-muted) 45%, transparent); }
.tchip input { position: absolute; inset: 0; width: 100%; height: 100%; min-height: 0; margin: 0; padding: 0; border: 0; opacity: 0; cursor: pointer; }
.tchip:has(input:checked) { color: var(--color-bg); background: var(--color-accent); border-color: var(--color-accent); font-weight: 600; }
.tchip:has(input:focus-visible) { outline: 2px solid var(--color-accent); outline-offset: 2px; }
.tchip .n { font-size: 10px; opacity: .65; }
.tchip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--lvl, var(--color-muted)); }
.tchip[style*="--lvl"]:has(input:checked) { background: color-mix(in srgb, var(--lvl) 22%, transparent); border-color: var(--lvl); color: var(--color-text); }
.segmented .tchip { justify-content: center; min-height: 32px; padding: 4px 6px; border: 0; border-radius: 8px; text-align: center; }
.segmented .tchip:has(input:checked) { background: var(--color-surface); color: var(--color-accent); }
.library-filters .filter-text { width: 100%; min-height: 36px; padding: 6px 10px; border-radius: 8px; border: 1px solid color-mix(in srgb, var(--color-muted) 22%, transparent); background: var(--color-bg); color: inherit; font: inherit; }
.switch { position: relative; display: flex; align-items: center; gap: 10px; min-height: 30px; cursor: pointer; }
.switch input { position: absolute; inset: 0; width: 100%; height: 100%; min-height: 0; margin: 0; padding: 0; border: 0; opacity: 0; cursor: pointer; }
.switch .track { position: relative; flex: none; width: 32px; height: 18px; border-radius: 999px; background: var(--color-bg); border: 1px solid color-mix(in srgb, var(--color-muted) 30%, transparent); transition: background-color 120ms; }
.switch .track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; border-radius: 50%; background: var(--color-muted); transition: transform 120ms ease-out, background-color 120ms; }
.switch:has(input:checked) .track { background: var(--color-accent); border-color: var(--color-accent); }
.switch:has(input:checked) .track::after { transform: translateX(14px); background: var(--color-bg); }
.switch:has(input:focus-visible) .track { outline: 2px solid var(--color-accent); outline-offset: 2px; }
.reset-filters { width: 100%; font-size: 13px; background: var(--color-bg); }

/* Карточка пака */
.library-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.pack-card { display: flex; flex-direction: column; gap: 12px; padding: 14px; border: 1px solid color-mix(in srgb, var(--color-muted) 10%, transparent); border-radius: 14px; background: var(--color-surface); cursor: pointer; transition: border-color 120ms, background-color 120ms; }
.pack-card:hover, .pack-card:focus-within { border-color: color-mix(in srgb, var(--color-accent) 70%, transparent); background: color-mix(in srgb, var(--color-surface) 92%, white); }
.pc-head { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 12px; align-items: start; }
.pc-cover { width: 64px; height: 64px; border-radius: 10px; object-fit: cover; background: var(--color-bg); font-size: 24px; }
.pc-title { display: grid; gap: 2px; min-width: 0; }
.pc-name { font-size: 15px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.25; }
.pc-authors { font-size: 12px; color: var(--color-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pc-meta { font-size: 12px; color: var(--color-muted); opacity: .8; }
.level-chip { padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; white-space: nowrap; color: var(--lvl); background: color-mix(in srgb, var(--lvl) 16%, transparent); border: 1px solid color-mix(in srgb, var(--lvl) 40%, transparent); }
.pc-topics { display: grid; gap: 6px; }
.topic-bar { display: flex; gap: 2px; height: 6px; border-radius: 3px; overflow: hidden; background: var(--color-bg); }
.topic-bar.wide { height: 10px; border-radius: 5px; }
.topic-seg { min-width: 2px; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 12px; margin: 0; padding: 0; list-style: none; font-size: 12px; color: var(--color-muted); }
.legend li { display: inline-flex; align-items: center; gap: 5px; }
.legend b { color: var(--color-text); font-weight: 600; }
.swatch { width: 8px; height: 8px; border-radius: 2px; flex: none; }
.pc-tags { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 10px; }
.pc-mix { display: flex; gap: 10px; font-size: 11px; color: var(--color-muted); }
.mix { display: inline-flex; align-items: center; gap: 3px; }
.mix .icon { width: 14px; height: 14px; opacity: .8; }
.pc-badges { display: flex; flex-wrap: wrap; gap: 4px; }
.badge { display: inline-flex; align-items: center; gap: 3px; padding: 2px 8px; border-radius: 999px; background: var(--color-bg); color: var(--color-muted); font-size: 11px; }
.badge .icon { width: 12px; height: 12px; }
.badge-ok { color: var(--color-ok); }
.badge-warn { color: var(--color-accent); }
.pc-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: auto; padding-top: 12px; border-top: 1px solid color-mix(in srgb, var(--color-muted) 12%, transparent); }
.pc-stats { display: flex; flex-wrap: wrap; row-gap: 8px; column-gap: 18px; margin: 0; min-width: 0; }
.pc-stats > div { display: flex; flex-direction: column-reverse; gap: 1px; }
.pc-stats dd { margin: 0; font-size: 15px; font-weight: 700; line-height: 1.1; white-space: nowrap; }
.pc-stats dt { font-size: 11px; color: var(--color-muted); }
.pc-nostats dt { font-size: 12px; }
.pc-foot .play-pack { display: inline-flex; align-items: center; gap: 6px; flex: none; min-height: 40px; padding: 6px 16px; border-radius: 10px; font-weight: 600; }
.pc-foot .play-pack .icon { width: 16px; height: 16px; }
.pack-card.skeleton { min-height: 200px; opacity: 0; animation: skeleton-in 0s 200ms forwards; }
@keyframes skeleton-in { to { opacity: .5; } }
.show-more { justify-self: center; margin: 12px auto; }
.library-message { display: grid; justify-items: center; gap: 8px; padding: 32px 0; text-align: center; }

/* Подробная карточка */
.back-to-catalog { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 12px; }
.pack-detail { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 28px; align-items: start; }
.pd-side { display: grid; gap: 12px; align-content: start; position: sticky; top: 64px; }
.pd-cover { width: 220px; height: 220px; border-radius: 14px; object-fit: cover; background: var(--color-surface); font-size: 64px; }
.play-pack.wide { width: 100%; display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-weight: 600; }
.facts { display: grid; gap: 6px; margin: 0; padding: 10px 12px; border-radius: 10px; background: var(--color-surface); font-size: 12px; }
.fact { display: flex; justify-content: space-between; gap: 8px; }
.fact dt { color: var(--color-muted); }
.fact dd { margin: 0; text-align: right; font-weight: 600; }
.pd-source { display: grid; gap: 4px; margin: 0; font-size: 12px; }
.pd-source:empty { display: none; }
.pd-authors a, .pd-source a { color: var(--color-accent); }
.pd-main { display: grid; gap: 22px; min-width: 0; }
.pd-head { display: grid; gap: 6px; }
.pd-title { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.pd-name { margin: 0; font-size: 26px; line-height: 1.15; }
.pd-authors { margin: 0; color: var(--color-muted); }
.pd-section { display: grid; gap: 8px; }
.pd-section h3, .pd-card h3 { margin: 0; font-size: 15px; }
.pd-section h4 { margin: 4px 0 0; font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--color-muted); }
.pd-empty { margin: 0; font-size: 13px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.kpi { display: grid; gap: 2px; align-content: start; padding: 10px 12px; border-radius: 10px; background: var(--color-surface); }
.kpi b { font-size: 22px; line-height: 1.15; }
.kpi span { font-size: 12px; color: var(--color-muted); }
.kpi-bar { display: block; height: 4px; margin-top: 6px; border-radius: 2px; background: var(--color-bg); overflow: hidden; }
.kpi-bar i { display: block; height: 100%; border-radius: 2px; background: var(--color-accent); }
.pd-charts { display: flex; flex-wrap: wrap; gap: 12px; }
.pd-card { flex: 1 1 280px; display: grid; gap: 10px; align-content: start; padding: 14px; border-radius: 12px; background: var(--color-surface); }
.decades { display: flex; align-items: stretch; gap: 8px; height: 96px; }
.decade { display: grid; grid-template-rows: auto 1fr auto; justify-items: center; gap: 3px; flex: 1 1 0; min-width: 0; }
.decade-value { font-size: 10px; color: var(--color-muted); }
.decade-bar { align-self: end; width: 100%; min-height: 2px; border-radius: 4px 4px 0 0; background: linear-gradient(to top, color-mix(in srgb, var(--color-accent) 55%, transparent), var(--color-accent)); }
.decade-label { font-size: 11px; color: var(--color-muted); }
.hbars { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; font-size: 12px; }
.hbars li { display: grid; grid-template-columns: minmax(0, 1fr) minmax(60px, 45%) 34px; align-items: center; gap: 8px; }
.hbar-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hbar { display: block; height: 6px; border-radius: 3px; background: var(--color-bg); overflow: hidden; }
.hbar i { display: block; height: 100%; border-radius: 3px; background: var(--topic-games); }
.hbars b { text-align: right; font-weight: 600; }
.media-breakdown { display: grid; gap: 8px; }
.pd-rounds { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.pd-round { display: grid; gap: 6px; align-content: start; padding: 12px; border-radius: 12px; background: var(--color-surface); }
.pd-round h4 { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0; font-size: 13px; font-weight: 700; letter-spacing: 0; text-transform: none; color: var(--color-text); }
.pd-round-label { padding: 4px 10px; border-radius: 999px; background: var(--color-bg); color: var(--color-accent); line-height: 1.3; }
.pd-round-count { flex: none; font-size: 11px; font-weight: 400; color: var(--color-muted); white-space: nowrap; }
.pd-themes { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; font-size: 13px; line-height: 1.45; }
.pd-themes li { display: flex; justify-content: space-between; gap: 8px; min-width: 0; }
.pd-themes li > span:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.theme-hint { flex: none; font-size: 11px; color: var(--color-danger); }
.pd-description { margin: 0; white-space: pre-line; font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; color: var(--color-muted); }
.pd-description.clamped { display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; }
@media (max-width: 1400px) { .pack-detail { grid-template-columns: 180px minmax(0, 1fr); gap: 20px; } .pd-cover { width: 180px; height: 180px; } }



/* Оценка пака после партии */
.rate-pack { display: grid; gap: 8px; justify-items: center; margin: 16px auto 0; text-align: center; }
.rate-pack[hidden] { display: none; }
.rate-pack h3 { margin: 0; font-size: 16px; }
.rate-pack .stars { display: flex; gap: 4px; }
.rate-pack .star { width: 44px; height: 44px; padding: 8px; border: 0; border-radius: 8px; background: transparent; color: var(--color-accent); cursor: pointer; }
.rate-pack .star .icon { width: 100%; height: 100%; display: block; }
.rate-pack .star:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
.rate-pack .note { margin: 0; font-size: 12px; }
.rate-pack a { color: var(--color-accent); }
.tv-rate-note { margin: 8px 0 0; font-size: clamp(16px, 1.6vw, 28px); color: var(--color-muted); text-align: center; }

/* Телефон игрока, пока выбирают вопрос: поле строками и счёт стола. */
.player-board { display: grid; gap: 14px; width: 100%; }
.player-board-themes, .player-standings { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.player-board-theme { display: grid; gap: 6px; padding: 10px 12px; border-radius: 14px; background: var(--color-board); text-align: left; }
.player-board-name { color: var(--color-accent); font-weight: 650; font-size: 16px; line-height: 1.2; overflow-wrap: anywhere; }
.player-board-prices { display: flex; flex-wrap: wrap; gap: 6px; }
.player-board-price { min-width: 48px; padding: 4px 8px; border-radius: 8px; background: color-mix(in srgb, var(--color-accent) 16%, transparent); color: var(--color-accent); font-weight: 650; font-variant-numeric: tabular-nums; text-align: center; }
.player-board-price.used { background: transparent; color: color-mix(in srgb, var(--color-muted) 55%, transparent); text-decoration: line-through; }
.player-standings li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 12px; border-radius: 12px; border: 1px solid #ffffff1f; }
.player-standings li.me { border-color: var(--color-accent); }
.player-standings li.picker { background: color-mix(in srgb, var(--color-accent) 12%, transparent); }
.player-standings .drawn-name { width: 110px; max-width: 45vw; height: 40px; }
.player-standings strong { color: var(--color-accent); font-size: 20px; font-variant-numeric: tabular-nums; }

/* Темы финала на доске: без строки цен, вычеркнутые погашены. */
.game-board .theme.struck h2 { opacity: .35; text-decoration: line-through; }

/* Баннер «вы хост этой комнаты»: возврат или закрытие до истечения благодати. */
.host-return { display: grid; gap: 12px; padding: clamp(14px, 2dvh + .8vw, 20px) clamp(16px, 2.2dvh + 1vw, 28px); border: 1px solid rgba(255, 218, 120, .4); border-radius: 22px; background: linear-gradient(150deg, #33316f 0%, #26245f 100%); box-shadow: 0 16px 32px rgba(6, 7, 35, .17), inset 0 1px rgba(255, 255, 255, .06); }
.host-return p { margin: 0; font-size: clamp(13px, 1.5dvh + .6vw, 15px); line-height: 1.55; color: var(--home-secondary); text-align: center; }
.host-return p strong { color: var(--color-text); font-variant-numeric: tabular-nums; }
.host-return-word { display: inline-block; padding: 2px 6px; border: 1px solid rgba(255, 218, 120, .55); border-radius: 8px; color: var(--home-yellow); letter-spacing: 1px; margin-right: -1px; }
.host-return-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.host-return-actions .press { min-height: 48px; font-weight: 800; }
.host-return-actions .press:first-child { background: linear-gradient(180deg, #ffe08b, #ffd171); border-color: transparent; color: var(--home-ink); }
.host-return-actions .press:first-child:hover { filter: brightness(1.04); }
/* Низкие экраны: баннер компактнее, иначе он один съедает бюджет без прокрутки. */
@media (max-height: 720px) {
  .host-return { gap: 8px; padding: 10px 12px; border-radius: 18px; }
  .host-return p { font-size: 12px; }
  .host-return-actions { gap: 8px; }
  .host-return-actions .press { min-height: 44px; font-size: 14px; }
}

/* Главная по макету редизайна (ноябрь 2026): шапка во всю ширину, интро и две
   карточки. Кнопка TG-канала (.tg-channel) не меняется. Вертикальные размеры
   тянутся за высотой вьюпорта (dvh), декорации прячутся на низких экранах,
   чтобы контент влезал без прокрутки. Палитра — из макета, только в скоупе
   .home; глобальные токены не тронуты. Unbounded не вендорим (офлайн и без
   внешних запросов): стопка начинается с него, дальше системные. */
.shell:has(.home) { display: block; max-width: none; margin: 0; padding: 0; }
.shell:has(.home) > :not(.route-page) { width: min(calc(100% - 32px), 1120px); margin-inline: auto; }
.home {
  --home-bg: #151747;
  --home-header: #1b1d59;
  --home-panel: #222361;
  --home-raised: #303174;
  --home-line: rgba(194, 197, 255, .17);
  --home-line-strong: rgba(215, 216, 255, .33);
  --home-yellow: #ffda78;
  --home-ink: #282246;
  --home-secondary: #c8c9e4;
  background:
    radial-gradient(ellipse 630px 400px at 50% 8%, rgba(48, 46, 122, .28), transparent 75%),
    var(--home-bg);
}
.site-header {
  height: clamp(52px, 8dvh, 68px);
  border-bottom: 1px solid var(--home-line);
  background: rgba(27, 29, 89, .96);
}
.header-inner {
  width: min(calc(100% - 32px), 1120px);
  height: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.home .brand-mark { height: 100%; display: flex; align-items: center; }
.home .brand-mark .brand-home { height: calc(100% - 10px); }
.home .brand-logo.brand-wordmark { align-self: center; width: clamp(68px, 10vw, 124px); }
.site-sound { flex: none; }
.site-actions { display: flex; align-items: center; gap: clamp(6px, 1.4vw, 12px); min-width: 0; }
.site-link {
  flex: none;
  padding: 8px 12px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--home-secondary);
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
}
.site-link:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.site-link:focus-visible { outline: 2px solid var(--home-yellow); outline-offset: 2px; }
@media (max-width: 480px) {
  .site-link { padding: 8px; font-size: 13px; }
}

.site-sound button {
  display: grid;
  place-items: center;
  width: clamp(40px, 6dvh, 46px);
  height: clamp(40px, 6dvh, 46px);
  min-width: 0;
  min-height: 0;
  padding: 0;
  border: 1px solid var(--home-line);
  border-radius: 15px;
  background: #303078;
  color: var(--home-secondary);
}
.site-sound button:hover { border-color: var(--home-line-strong); }
.site-sound button .icon { width: 21px; height: 21px; }
.page-shell {
  width: min(calc(100% - 32px), 1120px);
  min-height: calc(100dvh - clamp(52px, 8dvh, 68px) - var(--space-5) - env(safe-area-inset-bottom) - 8px);
  margin: 0 auto;
  padding: clamp(8px, 2.5dvh, 40px) 0 clamp(52px, 8dvh, 72px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(10px, 2dvh, 32px);
}
.home .page-shell:has(> :is(.create-kind, .find-rooms)) {
  justify-content: flex-start;
  min-height: 0;
  padding-block: var(--panel-pad);
  gap: var(--layout-gap);
}
.shell:has(.home) > .brand-head { display: none; }
.shell:has(.create-kind), .shell:has(.find-rooms) { align-content: start; }
.find-rooms > .return-room { justify-self: start; width: auto; }
.shell:has(.join-form):not(.wide) { align-content: start; gap: var(--layout-gap); }
.join-form :is(.name-mode, .player-setup) { min-width: 0; }
.join-form .name-mode { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.join-form .name-mode .press { flex: 1 1 9rem; min-height: var(--control-height); justify-content: center; }
.player-setup .join-submit { margin-block-start: var(--space-4); }
.player-mode .player form.turn-actions { display: grid; gap: var(--space-3); align-content: start; width: 100%; }
.player-mode .player form.turn-actions :is(input, textarea, .press) {
  box-sizing: border-box; width: 100%; min-width: 0; min-height: var(--control-height); border-radius: var(--control-radius);
}
.home-intro { text-align: center; container-type: inline-size; }
.home-intro h1 {
  margin: 0 0 clamp(6px, 1.4dvh, 16px);
  font-family: "Unbounded", "Trebuchet MS", "Segoe UI", sans-serif;
  font-size: clamp(20px, 3dvh + 1.6vw, 50px);
  font-size: min(8.6cqw, 52px);
  white-space: nowrap;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -.035em;
}
.home-intro h1 span { color: var(--home-yellow); }
/* Подзаголовки подсcreens в той же строке-интро: в одну строку, как h1. */
.home-intro h2 { margin: 0 0 clamp(6px, 1.4dvh, 16px); font-size: clamp(18px, 2.2dvh + 1.2vw, 34px); font-weight: 800; line-height: 1.2; letter-spacing: -.02em; white-space: nowrap; }
.home-sub { margin: 0; font-size: clamp(12px, 1.5dvh + .6vw, 17px); font-size: min(3.63cqw, 22.7px); white-space: nowrap; line-height: 1.5; color: var(--home-secondary); }
.home-layout { display: grid; grid-template-columns: 1fr; gap: clamp(10px, 1.8dvh, 18px); }
/* Правовые ссылки в подвале главной: постоянный доступ к документам, даже если
   тур уже закрыт. Стоят ниже кнопки канала, поэтому не увеличивают высоту
   главной и не ломают «без прокрутки» на низких экранах. */
.home-legal {
  position: absolute;
  left: 50%;
  bottom: calc(10px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2px 8px;
  width: min(calc(100% - 24px), 1120px);
  margin: 0;
  color: #a9a8c7;
  font-size: 11px;
  line-height: 1.35;
  text-align: center;
}
.home-legal a { color: #a9a8c7; text-decoration: underline; text-underline-offset: 2px; }
.home-legal a:hover { color: #fff; }
.home-legal a:focus-visible { outline: 2px solid var(--home-yellow); outline-offset: 2px; }

.action-card {
  display: flex;
  flex-direction: column;
  gap: clamp(8px, 1.2dvh, 12px);
  min-width: 0;
  min-height: 0;
  padding: var(--panel-pad);
  border: 1px solid rgba(188, 190, 255, .19);
  border-radius: 23px;
  background: linear-gradient(150deg, #292a70 0%, #222361 100%);
  box-shadow: 0 16px 32px rgba(6, 7, 35, .17), inset 0 1px rgba(255, 255, 255, .06);
}
.card-title-row { display: flex; align-items: center; gap: 12px; }
.card-head { display: grid; gap: clamp(10px, 1.6dvh, 18px); }
.card-title-row h2 { margin: 0; font-size: clamp(16px, 1.6dvh + .8vw, 24px); line-height: 1.2; font-weight: 800; letter-spacing: -.015em; white-space: nowrap; }
.card-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: clamp(38px, 5dvh, 52px);
  height: clamp(38px, 5dvh, 52px);
  border-radius: 15px;
  border: 1px solid rgba(255, 218, 120, .22);
  background: #373471;
  color: var(--home-yellow);
}
.card-icon .icon { width: 50%; height: 50%; }
.card-icon .icon svg { display: block; width: 100%; height: 100%; }
.card-icon.join-icon { background: #333577; border-color: rgba(201, 201, 255, .2); color: #d5d3ff; }
.card-desc { margin: 0; font-size: clamp(12px, 1.4dvh + .5vw, 15px); line-height: 1.5; color: var(--home-secondary); }
.room-preview { display: flex; align-items: center; gap: 10px; margin-top: auto; padding-top: 4px; font-size: clamp(12px, 1.4dvh + .5vw, 14px); color: #d0d0ec; }
.avatar-stack { display: flex; align-items: center; padding-left: 3px; }
.mini-avatar {
  display: grid;
  place-items: center;
  flex: none;
  width: clamp(30px, 4dvh, 39px);
  height: clamp(30px, 4dvh, 39px);
  margin-left: -4px;
  border: 3px solid #292a70;
  border-radius: 50%;
  font-size: .85em;
  line-height: 1;
  font-weight: 750;
  color: #29234d;
}
.mini-avatar + .mini-avatar { margin-left: -9px; }
.mini-avatar:nth-child(1) { background: #ffe0a2; }
.mini-avatar:nth-child(2) { background: #bfe8d5; }
.mini-avatar:nth-child(3) { background: #c9c1ff; }
.return-room {
  width: 100%;
  min-height: var(--touch-min);
  padding: 8px 14px;
  border: 1px solid var(--home-line-strong);
  border-radius: 12px;
  background: transparent;
  color: var(--home-secondary);
  font-weight: 700;
  cursor: pointer;
}
.home .home-notice, .home .home-pack { font-size: 13px; }
.primary-button, .join-button {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: clamp(48px, 6dvh, 58px);
  padding: 10px 20px;
  border: 1px solid transparent;
  border-radius: 15px;
  font-size: 16px;
  line-height: 1.35;
  font-weight: 800;
  color: var(--home-ink);
  background: linear-gradient(180deg, #ffe08b, #ffd171);
  box-shadow: 0 5px 0 rgba(8, 9, 38, .14), inset 0 1px rgba(255,255,255,.36);
  cursor: pointer;
}
.primary-button:hover, .join-button:not(:disabled):hover { filter: brightness(1.04); }
.primary-button:active, .join-button:active { transform: scale(.99); }
.primary-button:disabled, .join-button:disabled { opacity: .55; cursor: not-allowed; box-shadow: none; }
.join-button:disabled { color: var(--home-secondary); background: #414284; border-color: var(--home-line); }
.button-arrow { position: absolute; right: 20px; display: inline-flex; opacity: .7; }
.button-arrow .icon { width: 20px; height: 20px; }
.home-join-form { margin-top: auto; display: grid; gap: clamp(8px, 1.4dvh, 12px); }
.input-wrap { position: relative; }
.room-input {
  width: 100%;
  height: clamp(46px, 5.6dvh, 56px);
  padding: 0 48px 0 16px;
  border: 1px solid var(--home-line-strong);
  border-radius: 14px;
  outline: none;
  background: var(--home-raised);
  color: #fff;
  font-size: 16px;
  font-weight: 500;
  text-transform: uppercase;
}
.room-input::placeholder { color: #a3a6cc; font-weight: 400; text-transform: none; }
.room-input:focus { border-color: var(--home-yellow); outline: none; box-shadow: none; background: #303272; }
.room-input:focus-visible { outline: none; }
.input-icon { position: absolute; right: 18px; top: 50%; transform: translateY(-50%); color: #c3c4ea; pointer-events: none; }
.input-icon .icon { width: 20px; height: 20px; }
@media (min-width: 761px) and (min-height: 500px) {
  .site-header { height: clamp(60px, 10dvh, 76px); }
  .page-shell { min-height: calc(100dvh - clamp(60px, 10dvh, 76px) - var(--space-5) - env(safe-area-inset-bottom) - 8px); }
  .header-inner, .page-shell { width: min(calc(100% - 48px), 1120px); }
  .home-layout { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
  .action-card { border-radius: 26px; }
}
/* Низкие экраны: прогрессивная компакция декораций, контент влезает без прокрутки. */
@media (max-height: 900px) {
  .room-preview { display: none; }
}
@media (max-height: 840px) {
  .card-desc { display: none; }
}
@media (max-height: 700px) {
  .page-shell { gap: 8px; }
  .home-intro h1 { margin-bottom: 0; }
  .action-card { padding: 14px; }
}
@media (max-height: 620px) {
  .home-intro h1 { margin-bottom: 0; font-size: 20px; }
  .action-card { padding: 12px; gap: 8px; }
  .card-title-row h2 { font-size: 17px; }
  .primary-button, .join-button { min-height: 46px; }
  .room-input { height: 44px; }
}
@media (prefers-reduced-motion: reduce) {
  .home *, .home *::before, .home *::after { transition-duration: .01ms !important; }
}
/* Мобилки: внешние отступы 32→16px, паддинги карточек вдвое. */
@media (max-width: 620px) {
  .shell:has(.home) > :not(.route-page) { width: min(calc(100% - 16px), 1120px); }
  .header-inner, .page-shell { width: min(calc(100% - 16px), 1120px); }
  .action-card { padding: clamp(7px, 1dvh + .4vw, 15px); }
}

/* Push-переходы между экранами: текущий уезжает, новый приезжает справа
   (назад — зеркально). Классы ставит `follow` в net.rs; без движения — мгновенно. */
.route-page { display: grid; min-width: 0; min-height: 0; }
.route-page.leaving-fwd { animation: route-out-left .18s ease-in forwards; }
.route-page.leaving-back { animation: route-out-right .18s ease-in forwards; }
.route-page.entering-fwd { animation: route-in-right .3s ease-out; }
.route-page.entering-back { animation: route-in-left .3s ease-out; }
@keyframes route-out-left { to { transform: translateX(-100%); } }
@keyframes route-out-right { to { transform: translateX(100%); } }
@keyframes route-in-right { from { transform: translateX(100%); } }
@keyframes route-in-left { from { transform: translateX(-100%); } }
@media (prefers-reduced-motion: reduce) {
  .route-page.leaving-fwd, .route-page.leaving-back,
  .route-page.entering-fwd, .route-page.entering-back { animation: none; }
}
/* Слайды на всю ширину не должны давать горизонтальную прокрутку. */
body { overflow-x: clip; }

/* Модалка выхода с пульта: вопрос, комната удалится. */
.exit-backdrop { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 20px; background: rgba(6, 7, 28, .7); animation: exit-fade-in .15s ease-out; }
.exit-dialog { position: relative; width: min(100%, 380px); padding: 24px; border-radius: 22px; border: 1px solid rgba(191, 194, 255, .2); background: linear-gradient(150deg, #292a70 0%, #222361 100%); box-shadow: 0 30px 80px rgba(0, 0, 23, .55); text-align: center; animation: exit-pop-in .18s ease-out; }
.exit-dialog h2 { margin: 0 0 8px; font-size: 20px; }
.exit-dialog p { margin: 0 0 20px; font-size: 14px; line-height: 1.5; color: var(--color-muted); }
.exit-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.exit-actions .press { min-height: 48px; font-weight: 800; }
@keyframes exit-fade-in { from { opacity: 0; } }
@keyframes exit-pop-in { from { opacity: 0; transform: scale(.96) translateY(6px); } }
@media (prefers-reduced-motion: reduce) {
  .exit-backdrop, .exit-dialog { animation: none; }
}

/* Единый крестик модалок: круглый, полупрозрачный, верхний правый угол окна. */
.modal-x { position: absolute; top: 10px; right: 10px; display: inline-grid; place-items: center; width: 34px; min-width: 34px; height: 34px; min-height: 34px; padding: 0; border-radius: 50%; border: 1px solid rgb(255 255 255 / .14); background: rgb(255 255 255 / .08); color: inherit; }
.modal-x:hover { background: rgb(255 255 255 / .16); }
.modal-x:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
.modal-x .icon { width: 16px; height: 16px; }
.modal-x .icon svg { width: 100%; height: 100%; }
.player-settings-modal, .admin-confirm-modal { position: relative; }

/* Канал с новостями: единый кликабельный контейнер, по центру в самом низу главной.
   Правовые ссылки — в подвале под ним, ещё ниже. */
.shell:has(.home) { position: relative; padding-bottom: calc(var(--space-5) + env(safe-area-inset-bottom)); }
.tg-channel { position: absolute; bottom: calc(29px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; background: rgba(255, 255, 255, 0.12); color: var(--color-text); text-decoration: none; font-size: 14px; line-height: 1.2; white-space: nowrap; }
.tg-channel:hover { background: rgba(255, 255, 255, 0.2); }
.tg-channel:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
.tg-channel .icon { width: 20px; height: 20px; }
@media (min-width: 900px) and (min-height: 480px) and (min-aspect-ratio: 4/3) {
  .shell:has(.home) { padding-bottom: calc(clamp(12px, 3vh, 40px)); }
}
/* Низкие экраны: подвал (канал + документы) поднимаем внутрь вьюпорта,
   иначе на 320×568 и в ландшафте он уходит под нижнюю границу. */
@media (max-height: 620px) {
  .tg-channel { bottom: calc(34px + env(safe-area-inset-bottom)); }
  .home-legal { bottom: calc(18px + env(safe-area-inset-bottom)); font-size: 10.5px; line-height: 1.33; }
}

/* Домашняя секция «Найти игру» — обычная action-card в .home-layout
   (3 колонки ≥1240px, 2 — 761–1239, ниже — 1). Отдельных стилей не нужно. */
@media (min-width: 1240px) {
  .home-layout { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* Экран «Какую комнату создать?»: слайд справа налево, мгновенно при
   reduced-motion. */
.slide-in { animation: slide-in 250ms ease-out; }
@keyframes slide-in { from { transform: translateX(100%); } to { transform: translateX(0); } }
@media (prefers-reduced-motion: reduce) { .slide-in { animation: none; } }
.kind-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); gap: var(--layout-gap); }
.kind-card { display: flex; flex-direction: column; gap: var(--space-3); padding: var(--panel-pad); border-radius: var(--panel-radius); }
.kind-card h3 { margin: 0; font-size: 18px; }
.kind-card .note { margin: 0; }
/* Кнопка создания всегда прижата к низу карточки: у закрытой контента
   меньше, без этого она уезжает вверх относительно соседней. */
.kind-card .primary-button { margin-top: auto; }
/* Шапка «Какую комнату создать?»: назад без подложки у левого края,
   заголовок по центру строки. */
.create-kind-head { display: flex; align-items: center; gap: 12px; }
.create-kind-head h2 { flex: 1; min-width: 0; margin: 0; font-size: clamp(20px, 2vw + 12px, 32px); font-weight: 800; line-height: 1.2; letter-spacing: -.02em; text-align: start; text-wrap: balance; }
.back-link { flex: none; padding: 8px 4px; border: 0; background: transparent; color: var(--home-secondary); font-weight: 700; cursor: pointer; }
.back-link:hover { filter: brightness(1.15); }
/* Тумблер «Показать в Списке игр»: нативный чекбокс + iOS-трек. */
.listed-switch { justify-self: start; }
.listed-switch .switch-label { font-weight: 700; color: var(--home-secondary); }

/* Список открытых игр: десктоп — 2 колонки карточек, фильтр в 1 строку. */
.find-rooms h2 { margin: 0; font-size: 20px; }
.find-filter { flex-wrap: nowrap; }
.find-filter .press { white-space: nowrap; }
/* Экраны выбора комнаты и списка игр — в домашней оболочке: те же
   контейнеры, кнопки и карточки, что на главной. */
.create-kind, .find-rooms { display: grid; gap: var(--layout-gap); align-content: start; min-width: 0; }
.find-filter { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; padding: 5px; border: 1px solid var(--home-line); border-radius: var(--control-radius); background: var(--home-panel); }
.find-filter .press { min-width: 0; min-height: var(--control-height); margin: 0; padding: 8px; border: 1px solid transparent; border-radius: 11px; background: transparent; color: var(--home-secondary); font-size: var(--text-label); font-weight: 700; white-space: normal; }
.find-filter .press.pressed { background: linear-gradient(180deg, #ffe08b, #ffd171); border-color: transparent; color: var(--home-ink); }
.find-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); gap: var(--layout-gap); }
/* Карточка партии — выразительная, в языке главной/админки: слово крупно,
   бейдж фазы, пак и счётчики. Селектор через .find-grid, чтобы не задевать
   домашнюю секцию .find-game. */
.find-grid .find-card { display: flex; flex-direction: column; min-width: 0; gap: var(--space-2); padding: var(--panel-pad); border: 1px solid #786adc99; border-radius: var(--panel-radius); background: linear-gradient(135deg, #29286d, #1b1b50); box-shadow: 0 12px 28px #08082625, inset 0 1px #ffffff08; text-align: left; color: #fff; }
.find-grid .find-card:hover { border-color: #a396ff; }
.find-card-head { display: flex; flex-wrap: wrap; align-items: start; justify-content: space-between; gap: 12px; width: 100%; }
.find-card-title { display: grid; flex: 1 1 9rem; min-width: 0; gap: 4px; }
.find-card-head strong { font-size: clamp(26px, 3vw, 40px); line-height: 1.05; font-weight: 850; letter-spacing: -.025em; text-transform: uppercase; overflow-wrap: anywhere; }
.find-phase { display: inline-flex; align-items: center; gap: 6px; flex: none; padding: 5px 10px; border: 1px solid; border-radius: 999px; font-size: 12px; font-weight: 750; white-space: nowrap; }
.find-phase .icon { width: 18px; height: 18px; flex: none; }
.find-phase-lobby { background: #786adc15; border-color: #897ae3; color: #d7d0ff; }
.find-phase-live { background: #ffd66c18; border-color: var(--home-yellow); color: var(--home-yellow); }
.find-pack { font-size: 16px; line-height: 1.35; font-weight: 650; color: #b8b3ed; overflow-wrap: anywhere; }
.find-card-stats { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 10px 16px; width: 100%; margin-top: auto; padding-top: clamp(14px, 2vw, 26px); }
.find-card-group { display: flex; flex-wrap: wrap; gap: 8px; min-width: 0; }
.find-metric { display: inline-flex; align-items: center; gap: 6px; min-width: 0; min-height: 36px; padding: 4px 6px 4px 10px; border: 1px solid #8573dc; border-radius: 999px; background: #6452b720; color: #ece9ff; font-size: 12px; font-variant-numeric: tabular-nums; }
.find-metric .icon { width: 18px; height: 18px; flex: none; }
.find-metric-label { font-size: 11px; font-weight: 750; text-transform: uppercase; letter-spacing: .025em; }
.find-metric b { display: grid; place-items: center; min-width: 26px; padding: 2px 8px; border-radius: 11px; background: linear-gradient(135deg, #7846f1, #5130b5); font-size: 16px; font-weight: 800; line-height: 1.3; white-space: nowrap; }
.find-metric-round { border-color: var(--home-yellow); background: #ffd66c15; }
.find-metric-round > .icon { color: var(--home-yellow); }
.find-metric-round b { background: var(--home-yellow); color: var(--home-ink); }
.find-metric-age { padding-inline: 10px; color: var(--home-secondary); }
.find-empty { display: grid; gap: 12px; justify-items: stretch; }

/* Реакции наблюдателя: слой частиц поверх всего, панель кнопок сбоку.
   Слой клики не перехватывает. */
.reactions-layer { position: fixed; inset: 0; z-index: 70; overflow: hidden; pointer-events: none; }
.reaction-particle {
  position: absolute;
  left: 0;
  top: 0;
  width: var(--rx-size);
  height: var(--rx-size);
  font-size: var(--rx-size);
  line-height: 1;
  offset-rotate: 0deg;
  offset-anchor: center;
  opacity: 0;
  animation: react-float var(--rx-time) linear var(--rx-delay) both;
}
@keyframes react-float {
  0% { offset-distance: 0%; opacity: 0; }
  8% { opacity: 1; }
  85% { opacity: 1; }
  100% { offset-distance: 100%; opacity: 0; }
}
.reaction-glyph { display: grid; place-items: center; width: 100%; height: 100%; }
.reaction-glyph.pulse { animation: react-pulse 650ms ease-in-out var(--rx-delay) infinite alternate; }
.reaction-glyph.burst { animation: react-burst var(--rx-time) ease-in-out var(--rx-delay) both; }
@keyframes react-pulse { from { transform: scale(.94); } to { transform: scale(1.06); } }
@keyframes react-burst { 0%, 28% { transform: scale(1); } 40% { transform: scale(var(--rx-burst)); } 49%, 100% { transform: scale(0); } }
/* Restrictions also apply to particles already flying when a question opens. */
.reactions-layer.quiet .from-bottom { visibility: hidden; }
.reactions-layer.quiet .reaction-glyph { animation: none; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reaction-particle { offset-distance: 16%; animation-name: react-fade; }
  .reaction-glyph { animation: none !important; transform: none; }
  @keyframes react-fade {
    0% { opacity: 0; }
    20% { opacity: 1; }
    100% { opacity: 0; }
  }
}
.reactions-panel { position: absolute; z-index: 71; right: max(12px, env(safe-area-inset-right)); bottom: max(12px, env(safe-area-inset-bottom)); width: 62px; height: 48px; }
.reactions-toggle { width: 100%; height: 48px; border: 1px solid var(--ctl-border); border-radius: var(--control-radius); }
.reactions-buttons { position: absolute; bottom: calc(100% + 8px); right: 0; display: grid; grid-template-columns: 44px; width: 62px; max-height: calc(100dvh - 84px); overflow-y: auto; gap: 4px; padding: 8px; box-sizing: border-box; background: var(--color-surface); border: 1px solid var(--ctl-border); border-radius: var(--control-radius); box-shadow: 0 8px 24px #0005; }
.reactions-buttons[hidden] { display: none; }
.reactions-toggle, .reaction-button { min-width: 44px; min-height: 44px; display: grid; place-items: center; padding: 6px; font-size: 24px; line-height: 1; }
.reactions-toggle .icon { width: 24px; height: 24px; }

/* Выключение тем пака до старта: список в сайдбаре и таблицы в центре пульта. */
.summary-theme { display: block; width: 100%; padding: 4px 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
@media (min-width: 1024px) {
  /* Сводка прокручивается целиком: раскрытые раунды не создают второй скролл. */
  .host-library .game-summary { display: flex; flex-direction: column; gap: 8px; min-height: 0; overflow-y: auto; scrollbar-width: thin; }
  .host-library .game-summary > :not(.summary-rounds) { flex: none; }
  .host-library .summary-rounds { min-height: 0; overflow: visible; }
  .host-library .summary-rounds .rounds-body { max-height: none; overflow: visible; }
  .host-library .summary-actions { position: static; }
  .host-library .theme-tables-open { margin-top: 0; }
  .host-library .summary-theme { min-height: 28px; }
  .host-library .summary-rounds .rounds-body { align-content: start; }
}
.summary-theme:disabled { cursor: default; }
.summary-theme:not(:disabled):hover { color: var(--color-text); }
.summary-theme:focus-visible, .theme-tile:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
.summary-theme.theme-off .theme-name, .theme-tile.theme-off .theme-name { text-decoration: line-through; opacity: 0.55; }
.theme-tables-open { width: 100%; margin-top: 8px; }
.theme-tables { display: flex; flex-direction: column; gap: 16px; min-height: 0; height: 100%; overflow-y: auto; scrollbar-width: thin; }
.theme-tables[hidden] { display: none; }
.theme-tables-head { position: sticky; top: 0; z-index: 1; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding-bottom: 8px; background: var(--color-bg); }
.theme-tables-head h2 { margin: 0 0 4px; font-size: 20px; }
.theme-tables-head .note { margin: 0; }
.theme-table { display: grid; gap: 8px; }
.theme-table h3 { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 14px; }
.theme-table.not-played { opacity: 0.6; }
.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.theme-tile { display: flex; align-items: center; justify-content: center; min-height: 64px; padding: 8px 10px; border: 1px solid color-mix(in srgb, var(--color-accent) 35%, transparent); border-radius: 8px; background: var(--color-surface); color: var(--color-text); font: inherit; font-size: 14px; line-height: 1.25; text-align: center; cursor: pointer; overflow-wrap: anywhere; }
.theme-tile:not(:disabled):hover { border-color: var(--color-accent); }
.theme-tile.theme-off { border-style: dashed; border-color: var(--color-danger); background: transparent; }
.theme-tile:disabled { cursor: default; }
.theme-table.final .theme-tile { border-color: color-mix(in srgb, var(--color-accent) 60%, transparent); }

/* Фильтр по тегам с тремя состояниями и теги тем в таблицах пульта. */
.tchip.tri { background: none; font: inherit; }
.tchip.tri .mark:empty { display: none; }
.tchip.tri .mark { font-weight: 700; }
.tchip.tri[data-pick="want"] { color: var(--color-bg); background: var(--color-accent); border-color: var(--color-accent); font-weight: 600; }
.tchip.tri[data-pick="skip"] { color: var(--color-danger); border-color: var(--color-danger); border-style: dashed; text-decoration: line-through; }
.tchip.tri:focus-visible, .theme-tag:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
.tag-filter .tchips + .tchips:not(:empty), .tag-filter .tchips + .filter-text { margin-top: 6px; }
.theme-tag-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.theme-tag-bar .note { margin: 0; }
.theme-tag { background: none; font: inherit; }
.theme-tag:not(:disabled):hover { color: var(--color-text); }
.theme-tag.theme-off { border-style: dashed; border-color: var(--color-danger); text-decoration: line-through; }
.theme-tile { flex-direction: column; gap: 4px; }
.theme-tags { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; }
.theme-tags .badge { font-size: 11px; }

/* Полосы прокрутки — везде как в левом сайдбаре: тонкие, полупрозрачные, без фона. */
* { scrollbar-width: thin; scrollbar-color: var(--scroll-thumb) transparent; }
*:hover { scrollbar-color: var(--scroll-thumb-hover) transparent; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track, ::-webkit-scrollbar-corner { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--scroll-thumb); border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: var(--scroll-thumb-hover); }
::-webkit-scrollbar-button { display: none; width: 0; height: 0; }

/* Единые размеры кнопок, полей и чипов настольного пульта и каталога (токены `--ctl-*`).
   Клетки поля, плитки тем и чипы-фильтры имеют свои размеры. Крупная «Начать игру» — отдельно. */
@media (min-width: 1024px) {
  .host-desk :is(button, select):not(.cell, .tchip, .chip-button, .theme-tile, .summary-theme, .theme-tag, .start-game, .pack-card, .bubble, .choice, .dock-effects, .pill-vote),
  .host-desk input:not([type="checkbox"], [type="radio"], [type="range"]),
  .host-desk .library-bar .search {
    min-height: var(--ctl-h); height: auto; border-radius: var(--ctl-radius); font-size: var(--ctl-font); line-height: 1.2;
  }
  .host-desk :is(button, select):not(.cell, .tchip, .chip-button, .theme-tile, .summary-theme, .theme-tag, .start-game, .pack-card, .bubble, .choice, .dock-effects, .pill-vote) {
    min-width: var(--ctl-h); padding: 6px 14px;
  }
  .host-desk :is(input:not([type="checkbox"], [type="radio"], [type="range"]), select),
  .host-desk .library-bar .search {
    padding: 6px 12px; border: 1px solid var(--ctl-border); background: var(--ctl-bg); color: var(--color-text);
  }
  .host-desk .library-bar .search { padding: 0 12px; }
  .host-desk .library-bar .search input, .host-desk .library-bar .search input:focus-visible { min-height: calc(var(--ctl-h) - 2px); padding: 0; border: 0; background: transparent; outline: none; }
  .host-desk .library-bar .search .icon { width: 16px; height: 16px; }
  .host-desk .library-bar .search:focus-within, .host-desk :is(input, select):focus-visible { outline: 2px solid var(--color-accent); outline-offset: 1px; border-color: transparent; }
  .host-desk .dock-effects { width: 32px; min-width: 32px; height: 32px; min-height: 32px; padding: 6px; border-radius: var(--ctl-radius); }
  .host-desk .dock-effects .icon { width: 18px; height: 18px; }
  .host-desk button.icon-button, .host-desk .summary-actions .icon-button, .host-desk .invitation button { display: inline-flex; align-items: center; justify-content: center; flex: none; width: var(--ctl-h); min-width: var(--ctl-h); height: var(--ctl-h); padding: 0; }
  .host-desk .icon-button .icon, .host-desk .press .icon { width: 18px; height: 18px; }
  .host-desk .library-filters .filter-text, .host-desk .library-filters select { background: var(--color-bg); }
  .host-desk .invitation input { font-size: 12px; }
  .host-desk .game-format button { padding: 6px 4px; font-size: 13px; }
  .host-desk .theme-tables-open { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .host-desk .play-pack { font-weight: 600; }
  .host-desk :is(.library-bar h2, .theme-tables-head h2, .sound-panel h2, .prompter h2, .game-format h2) { font-size: var(--heading-panel); }
  /* Шапка каталога всегда в одну строку: поиск сжимается, остальное фиксированной ширины. */
  /* Отступ сверху — место для обводки фокуса: шапка прилипает к краю прокрутки и иначе её режет. */
  .host-desk .library-bar { flex-wrap: nowrap; padding-top: 4px; }
  .host-desk .library-bar h2 { flex: none; white-space: nowrap; }
  .host-desk .library-bar .search { flex: 1 1 auto; min-width: 120px; }
  .host-desk .library-bar .sort { flex: 0 1 170px; min-width: 120px; }
  .host-desk .library-bar .filters-toggle, .host-desk .library-bar .icon-button { flex: none; }
  .host-desk .library { container-type: inline-size; }
  .host-desk .library-count { flex: none; white-space: nowrap; }
}
/* Узкая колонка каталога: сначала уходит заголовок, затем подпись «Фильтры» и счётчик. */
@container (max-width: 720px) {
  .host-desk .library-bar h2 { display: none; }
}
@container (max-width: 540px) {
  .host-desk .filters-toggle .label, .host-desk .library-count { display: none; }
  .host-desk .library-bar .filters-toggle { padding: 6px 10px; }
  .host-desk .library-bar .sort { flex-basis: 140px; min-width: 110px; }
}
@media (min-width: 1024px) {
  .host-desk :is(.chip-button, .tchip, .theme-tag) { min-height: var(--chip-h); padding: 4px 10px; border-radius: 999px; font-size: var(--chip-font); }
  /* Сегментный переключатель: прямоугольный контейнер, сегменты скруглены на величину его отступа меньше. */
  .host-desk .tchips.segmented { padding: 3px; border-radius: var(--ctl-radius); }
  .host-desk .segmented .tchip { min-height: 30px; border-radius: calc(var(--ctl-radius) - 3px); }
  .host-desk .difficulty-chips { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .host-desk .difficulty-chips .tchip { min-width: 0; padding: 5px 6px; gap: 4px; font-size: 11px; line-height: 1.2; }
  .host-desk .difficulty-chips .dot { flex: none; width: 6px; height: 6px; }
  /* Нижняя панель пульта: те же кнопки, иконка с отступом от текста. */
  .host-dock .host-controls button:not(.start-game, .dock-effects, .mobile-assistant) { min-height: var(--ctl-h); padding: 6px 14px; border-radius: var(--ctl-radius); font-size: var(--ctl-font); }
  .host-dock .host-controls button:not(.dock-effects, .mobile-assistant), .host-desk button.press:not(.icon-button, .mobile-assistant) { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
  .host-dock .start-game { border-radius: var(--ctl-radius); }
  .host-dock .start-game .icon, .host-dock .host-controls .icon { width: 18px; height: 18px; }
  /* Суфлёр — подсказка для чтения вслух, но не крупнее заголовков пульта. */
  .prompter-line.spoken { font-size: clamp(15px, 1.05vw, 18px); line-height: 1.45; }
}

.score-correction { flex: none; display: grid; gap: 10px; padding: 14px; border-top: 1px solid var(--border, #44406a); }
/* Десктопный пульт: три визуально разделённые группы управления. */
@media (min-width: 1024px) and (min-height: 581px) {
  .host-dock { background: linear-gradient(180deg, #101642, #0c1032); border-top-color: #343a79; }
  .host-dock .host-status { position: relative; min-width: 0; padding: 3px 16px 3px 18px; border-right: 1px solid #404675; }
  .host-dock .host-status::before { content: ""; position: absolute; left: 0; top: 4px; bottom: 4px; width: 4px; border-radius: 4px; background: #ffd45d; }
  .host-dock .host-status .host-round-title { font-size: clamp(15px, 1.2vw, 22px); }
  .host-dock .host-status .host-departed { font-size: clamp(12px, .9vw, 16px); overflow-wrap: anywhere; }
  .host-dock .host-controls { padding: 0 14px; }
  .host-dock .host-controls .row { justify-content: center; gap: 8px; }
  .host-dock .host-controls button:not(.start-game, .dock-effects, .mobile-assistant, .ok, .danger) { min-height: 44px; padding: 8px 15px; border: 1px solid #424b91; border-radius: 13px; background: linear-gradient(180deg, #292f72, #1b2058); box-shadow: inset 0 1px 0 #ffffff12; }
  .host-dock .host-controls button.ok,
  .host-dock .host-controls button.danger { min-height: 44px; padding: 8px 15px; border-radius: 13px; }
  .host-dock .host-controls button.ok { border-color: #2f8a5a; background: var(--color-ok); color: #142b22; }
  .host-dock .host-controls button.danger { border-color: #b54e62; background: var(--color-danger); color: #2a1020; }
  .host-dock .host-controls button:hover:not(:disabled) { filter: brightness(1.18); }
  .host-dock .dock-volume { min-width: 0; grid-template-columns: 44px minmax(0, 1fr); gap: 12px; padding-left: 14px; padding-right: 14px; border-left: 1px solid #404675; }
  .host-dock .dock-effects { width: 44px; min-width: 44px; min-height: 44px; padding: 9px; border: 1px solid #424b91; border-radius: 12px; background: #20265e; }
  .host-dock .volume-row { grid-template-columns: auto minmax(55px, 1fr); gap: 12px; font-size: clamp(12px, .85vw, 15px); }
  .host-dock .volume-row input { accent-color: #ffd45d; transform: none; }
}
.score-correction h3 { margin: 0; font-size: 15px; }
.score-correction label { display: grid; gap: 5px; font-size: 12px; }
.score-correction :is(select, input) { width: 100%; min-width: 0; min-height: 42px; box-sizing: border-box; }
.score-correction-row { display: grid; grid-template-columns: 42px minmax(0, 1fr) 42px; gap: 8px; align-items: center; }
.host-desk .score-correction-row button { min-width: 42px; min-height: 42px; padding: 8px; }
.score-correction-row .icon { width: 22px; height: 22px; }
.host-desk .score-minus { color: #ffb3b9; background: #622837; border-color: #b54e62; }
.host-desk .score-plus { color: #b3f5cd; background: #20533c; border-color: #468b66; }
.score-correction button:disabled { opacity: .45; }
.score-correction p { margin: 0; font-size: 12px; line-height: 1.4; }
.score-operation-status:empty { display: none; }
.modifier-hint { padding: 10px; color: #f8df93; background: #514325; border-radius: 8px; }
.tv-modifier-media { display: flex; justify-content: center; gap: 12px; }
.tv-modifier-media img { max-width: 45%; max-height: 22vh; object-fit: contain; }
 .room-members { margin-block: 1rem; }
 .room-members summary { cursor: pointer; }
 .room-member { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-block: .5rem; }
 .room-member .seat-name { min-width: 0; }

/* Player scenes use the available viewport; content is fitted, never scrolled. */
html:has(.shell.player-mode), body:has(.shell.player-mode),
html:has(.shell.tv-mode), body:has(.shell.tv-mode) { height: 100%; overflow: hidden; }
.shell.player-mode { display: flex; flex-direction: column; height: 100dvh; min-height: 0; max-height: 100dvh; padding-block: max(6px, env(safe-area-inset-top)) max(6px, env(safe-area-inset-bottom)); gap: min(1dvh, 10px); }
.shell.player-mode > div:has(.player) { display: flex; flex-direction: column; flex: 1; min-height: 0; width: 100%; }
/* Обёртка живого места под route-page: тянется вместе с колонкой, иначе
   доска игрока схлопывается (маршрут добавил уровень вложенности). */
.shell.player-mode .route-page > .seat-live-wrap:not([hidden]) { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.player-mode .player, .player-mode .player.compact { flex: 1; height: 100%; min-height: 0; max-height: 100%; gap: min(1dvh, 8px); }
.player-mode .player .question-card,
.player-mode .player:has(.buzz:not([hidden])) .question-card { flex: 1 1 0; min-height: 0; max-height: none; overflow: visible; }
.player-mode .player .question-content,
.player-mode .player:has(.buzz:not([hidden])) .question-content { min-height: 0; overflow: visible; }
/* Reserve the remaining track for the image; keep the question on one screen.
   Длинный текст без вариантов не обрезаем: карточка остаётся на экране,
   а сам текст прокручивается внутри неё (правило аудита — clipped-content). */
.player-mode .player .question-content:not(:has(.question-with-choices)),
.player-mode .player:has(.buzz:not([hidden])) .question-content:not(:has(.question-with-choices)) {
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}
.player-mode .player:has(.buzz:not([hidden])) .question-content:not(:has(.question-with-choices)) .question-images {
  flex: 1 1 0; min-height: 0; width: 100%; margin: 0;
}
.player-mode .player:has(.buzz:not([hidden])) .question-content:not(:has(.question-with-choices)) .question-image {
  width: 100%; height: 100%; min-height: 0; max-height: 100%; object-fit: contain;
}
.player-mode .player:has(.buzz:not([hidden])) .buzz { flex: 0 0 clamp(48px, 18dvh, 160px); min-height: 0; }
.player-mode .player .question-images { min-height: 0; flex: 1 1 0; }
.player-mode .player .question-image { max-height: 100%; object-fit: contain; }
/* Answer showcase: pin the theme and keep the answer and its media together. */
.player-mode .player .question-card.answer-show {
  display: flex; flex-direction: column; align-items: stretch; gap: 10px;
}
.player-mode .player .answer-show > .question-meta { flex: none; align-self: center; }
.player-mode .player .answer-show > .reveal-answer { flex: none; margin: auto 0 0; text-align: center; }
.player-mode .player .answer-show > .question-content {
  flex: 0 1 auto; min-height: 0; margin-bottom: auto; justify-content: flex-start; gap: 10px;
}
.player-mode .player .answer-show .question-images { flex: 0 1 auto; max-height: 40dvh; }
.player-mode .player .answer-show .question-image { width: auto; height: auto; max-width: 100%; max-height: 40dvh; }
.player-mode .player-board { flex: 1; min-height: 0; grid-template-rows: minmax(0, 1fr) auto; gap: min(2dvh, 12px); container-type: size; }
.player-mode .player-board-themes { min-height: 0; gap: min(1cqh, 6px); grid-auto-rows: minmax(0, 1fr); }
/* Счёт — по содержимому, а не пол-экрана: один игрок больше не растягивается,
   длинный стол прокручивается внутри своей полосы, а не давит темы. */
.player-mode .player-standings { min-height: 0; max-height: 32dvh; overflow-y: auto; gap: min(1cqh, 6px); grid-auto-rows: auto; }
.player-mode .player-board-theme { min-height: 0; gap: min(1cqh, 4px); padding: min(1cqh, 8px); }
.player-mode .player-board-name { font-size: clamp(12px, calc(22cqh / var(--theme-count)), 16px); }
/* Цены — равные колонки на всю ширину темы: подложка всегда во всю тему. */
.player-mode .player-board-prices { min-height: 0; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 2px; }
.player-mode .player-board-price { min-width: 0; padding: 1px; font-size: clamp(11px, calc(18cqh / var(--theme-count)), 14px); }
.player-mode .player-standings li { min-height: 28px; padding: min(1cqh, 6px); }
.player-mode .player-standings .drawn-name { max-height: clamp(22px, calc(38cqh / var(--player-count)), 40px); width: min(110px, 40vw); }
.player-mode .player-standings strong { font-size: clamp(14px, calc(30cqh / var(--player-count)), 20px); }
@media (orientation: landscape) and (max-height: 600px) {
  .player-mode .player-board { grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: minmax(0, 1fr); }
  .player-mode .effects-control { min-height: 0; padding-block: 0; }
  .player-mode .player-header-identity .drawn-name { max-height: 32px; }
  .player-mode .player-points .score { font-size: 20px; }
}

/* Parsed image alternatives stay paired with their labels across question and reveal. */
.question-choice-image { grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); align-items: center; min-width: 0; min-height: 0; }
.question-choice-image .question-choice-label { grid-column: 1 / -1; }
.question-choice-option-image { grid-column: 1 / -1; width: 100%; height: clamp(64px, 18vh, 220px); min-height: 0; object-fit: contain; border-radius: 8px; }
.question-choice-image .question-choice-text:empty { display: none; }
.question-image-options .question-choice-list { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: minmax(0, 1fr); gap: clamp(6px, 1vw, 14px); }
.question-image-options .question-choice-image { height: 100%; }

/* Compact scoreboard shown only during the cat handoff on player phones. */
.player-score-ticker { flex: 0 0 20px; height: 20px; min-height: 20px; max-width: 100%; overflow: hidden; color: var(--color-muted); font-size: 12px; line-height: 20px; }
.player-score-ticker-track { display: flex; width: max-content; min-width: 100%; align-items: center; gap: 18px; white-space: nowrap; animation: player-score-ticker 24s linear infinite; }
.player-score-ticker-item { display: inline-flex; align-items: center; gap: 5px; }
.player-score-ticker-item strong { color: var(--color-accent); font-variant-numeric: tabular-nums; }
@keyframes player-score-ticker { from { transform: translateX(0); } to { transform: translateX(-35%); } }
@media (prefers-reduced-motion: reduce) { .player-score-ticker-track { animation: none; } }

/* Audio is context, not the main content: leave the phone viewport for the buzz action. */
.player-mode .player:has(.question-media audio) .question-card { align-self: stretch; width: 100%; padding-inline: 8px; }
.player-mode .player:has(.question-media audio) .question-content { gap: 6px; }
.player-mode .player:has(.question-media audio) .question-media { flex: none; width: 100%; }
.player-mode .player:has(.question-media audio) audio { display: block; width: 100%; height: 40px; }

/* The secret theme is context for choosing a recipient, not a full question. */
.player-mode .cat-secret-title { margin: 0; color: var(--color-accent); font-size: 18px; line-height: 1.2; font-weight: 700; text-align: left; }
.player-mode .player:has(.cat-pass-actions) .question-card { flex: 0 0 auto; min-height: 0; padding: 12px; gap: 4px; }
.player-mode .player:has(.cat-pass-actions) .question-content { flex: none; min-height: 0; padding: 0; }
.player-mode .player:has(.cat-pass-actions) .question-card > section:empty,
.player-mode .player:has(.cat-pass-actions) .question-card .question-meta:empty { display: none; }
.player-mode .player:has(.cat-pass-actions) .question-text { font-size: clamp(16px, 4vw, 21px); }
.player-mode .cat-pass-selection { display: grid; flex: 0 0 auto; gap: 8px; min-width: 0; }
.player-mode .cat-pass-selection h2 { margin: 0; font-size: 16px; line-height: 1.3; font-weight: 600; }
.player-mode .cat-pass-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; align-items: stretch; }
.player-mode .cat-pass-actions .press { display: grid; place-items: center; min-width: 0; min-height: 60px; padding: 8px; }
.player-mode .cat-pass-actions .drawn-name { display: block; width: 100%; height: 44px; }

/* Онбординг на главной: пошаговый тур для новых посетителей. */
.onboarding-overlay { position: fixed; z-index: 120; inset: 0; display: grid; place-items: center; padding: 20px; background: #080a268c; backdrop-filter: blur(2px); animation: exit-fade-in .15s ease-out; }
/* Пока тур открыт, страница под ним не прокручивается. */
body:has(.onboarding-overlay) { overflow: hidden; }

.onboarding-card { display: flex; flex-direction: column; width: min(100%, 560px); max-height: min(92dvh, 760px); overflow: hidden; padding: 26px 26px 18px; border: 1px solid color-mix(in srgb, var(--color-muted) 35%, transparent); border-radius: var(--panel-radius); background: linear-gradient(150deg, #292a70 0%, #222361 100%); box-shadow: 0 30px 80px rgba(0, 0, 23, .55); animation: exit-pop-in .18s ease-out; }
.onboarding-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding-right: 4px; }
.onboarding-footer { flex: none; padding: 16px 4px 0 0; }
.onboarding-card h2 { margin: 0 0 14px; font-size: clamp(22px, 3.4vw, 28px); line-height: 1.2; color: #fff; }
.onboarding-card p { margin: 0 0 14px; font-size: 15px; line-height: 1.6; color: #e9e8f7; }
.onboarding-card p:last-child { margin-bottom: 0; }
.onboarding-card a { color: var(--color-accent); text-decoration: underline; }
.onboarding-progress { display: flex; gap: 8px; margin-bottom: 18px; }
.onboarding-dot { width: 8px; height: 8px; border-radius: 50%; background: color-mix(in srgb, var(--color-muted) 35%, transparent); }
.onboarding-dot.is-active { background: var(--color-accent); }
.onboarding-options { display: grid; gap: 10px; margin: 0 0 4px; }
.onboarding-option { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; border: 1px solid rgba(255, 255, 255, .14); border-radius: 12px; background: rgba(255, 255, 255, .06); }
.onboarding-option-badge { flex: none; display: grid; place-items: center; width: 28px; height: 28px; margin-top: 1px; border-radius: 50%; background: var(--color-accent); color: #1b1a55; font-size: 13px; font-weight: 800; line-height: 1; }
.onboarding-option p { margin: 0; color: #e9e8f7; }
.onboarding-note { margin: 0 0 14px; padding: 12px 14px; border-radius: var(--radius); background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .08); color: #dcdbf0; font-size: 13px; line-height: 1.5; }
.onboarding-roles { display: grid; gap: 12px; margin-bottom: 14px; }
.onboarding-role { width: 100%; min-height: 52px; padding: 12px 16px; border: 1px solid color-mix(in srgb, var(--color-muted) 35%, transparent); border-radius: var(--radius); background: var(--color-surface); color: var(--color-text); font-size: 16px; font-weight: 700; cursor: pointer; }
.onboarding-role:hover, .onboarding-role:focus-visible { border-color: var(--color-accent); }
.onboarding-actions { display: flex; gap: 12px; justify-content: stretch; margin-top: 0; }
.onboarding-actions .press,
.onboarding-actions .primary-button { flex: 1 1 0; width: auto; min-width: 0; }
.onboarding-actions .press:only-child { flex: 0 0 auto; min-width: 140px; padding-inline: 24px; }
.onboarding-actions .press { border: 1px solid rgba(255, 255, 255, .18); background: rgba(255, 255, 255, .08); }
.onboarding-actions .press:hover { background: rgba(255, 255, 255, .14); }
.onboarding-card .onboarding-legal { margin: 16px 0 0; font-size: 11px; line-height: 1.35; color: #a9a8c7; text-align: start; }
.onboarding-card .onboarding-legal a { color: #d8c58f; }
@media (max-width: 480px) {
  .onboarding-card { padding: 20px 20px 14px; }
  .onboarding-card p { font-size: 14px; line-height: 1.55; }
  .onboarding-option { padding: 10px 12px; gap: 10px; }
  .onboarding-option-badge { width: 26px; height: 26px; }
  .onboarding-note { font-size: 12.5px; }
  .onboarding-card .onboarding-legal { font-size: 10.5px; }
}
/* Телефон/планшет в ландшафте: контент слева, кнопки и согласие справа. */
@media (max-height: 480px) and (min-width: 640px) {
  .onboarding-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 260px;
    grid-template-rows: auto minmax(0, 1fr);
    column-gap: 24px;
    width: min(100%, 760px);
    max-width: 760px;
    padding: 20px 22px;
  }
  .onboarding-progress { grid-column: 1; grid-row: 1; margin-bottom: 12px; }
  .onboarding-body { grid-column: 1; grid-row: 2; }
  .onboarding-footer {
    grid-column: 2;
    grid-row: 1 / span 2;
    align-self: stretch;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding-top: 0;
  }
  .onboarding-actions { flex-direction: column; }
  .onboarding-actions .press,
  .onboarding-actions .primary-button { width: 100%; min-width: 0; }
}
@media (prefers-reduced-motion: reduce) { .onboarding-overlay, .onboarding-card { animation: none; } }
@media (max-height: 400px) and (orientation: landscape) {
  .player-mode .cat-pass-selection { gap: 4px; }
  .player-mode .cat-pass-selection h2 { font-size: 12px; }
  .player-mode .cat-pass-actions { gap: 4px; }
  .player-mode .cat-pass-actions .press { min-height: 30px; padding: 3px; }
  .player-mode .cat-pass-actions .drawn-name { height: 24px; }
}

/* Lobby actions follow the visible viewport, including mobile browser chrome. */
.shell.player-mode .player.lobby { display: flex; flex-direction: column; min-height: 0; }
.player-mode .player.lobby > button:not([hidden]):not(.change-role) { flex: none; margin-top: auto; margin-bottom: 0; }
.player-lobby-roster { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; min-height: 0; overflow-y: auto; }
.player-lobby-seat { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; padding: 10px; border: 1px solid #ffffff26; border-radius: 12px; background: #ffffff08; }
.player-lobby-seat .drawn-name { width: min(110px, 20vw); height: 36px; min-width: 0; }
.player-lobby-seat > span { font-size: 11px; color: var(--color-muted); }
.player-lobby-seat.ready { border-color: #60df9a80; }
.player-lobby-seat.ready > span { color: var(--color-ok); }
.player-mode .player-turn-note.my-turn { white-space: nowrap; font-size: clamp(10px, 3.15vw, 20px); line-height: 1.5; font-weight: 600; }
.player-mode:has(.player.choosing)::after { content: ""; position: fixed; inset: 0; z-index: 40; pointer-events: none; border-radius: 18px; box-shadow: inset 0 0 18px 5px #60df9a70, inset 0 0 60px 14px #60df9a24; animation: player-turn-glow 2.4s ease-in-out infinite; }
@keyframes player-turn-glow { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .player-mode:has(.player.choosing)::after { animation: none; opacity: .65; } }
.media-unlock { position: fixed; z-index: 100; bottom: max(20px, env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); width: max-content; max-width: 90vw; background: var(--color-accent); color: #151459; box-shadow: 0 4px 24px #0008; }

/* Drawn identities use the same renderer as the player canvas. */
.drawn-player-select { position: relative; min-width: 0; }
.drawn-player-select summary { display: flex; align-items: center; min-height: 44px; padding: 8px 12px; border: 1px solid #ffffff35; border-radius: 8px; cursor: pointer; background: var(--color-bg); }
.drawn-player-select summary::after { content: "⌄"; margin-left: auto; }
.drawn-player-select summary .drawn-name { height: 32px; width: 120px; }
.drawn-player-select.disabled { opacity: .5; }
.drawn-player-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; padding: 8px 0; max-height: 240px; overflow-y: auto; }
.host-desk .drawn-player-options button { display: grid; place-items: center; min-width: 0; padding: 8px; }
.drawn-player-options .drawn-name { width: 100%; height: 40px; }
.drawn-player-options button[aria-pressed="true"] { border-color: var(--color-ok); background: #60df9a22; }
.score-player-label { font-size: 12px; }
.host-cat-status { display: flex; flex: 1; flex-direction: column; align-items: center; justify-content: center; gap: 18px; min-height: 0; padding: 24px; text-align: center; background: var(--color-board); border-radius: var(--radius-lg); border: 1px solid #ffd66c55; }
.host-cat-status h2 { color: var(--color-accent); font-size: clamp(26px, 3vw, 46px); margin: 0; }
.host-cat-status p { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; margin: 0; font-size: clamp(18px, 2vw, 30px); }
.host-cat-status .drawn-name { width: 150px; height: 46px; }
.host-cat-status > strong { color: var(--color-accent); font-size: 26px; }
.host-cat-status.answering { flex: none; gap: 6px; padding: 10px 16px; margin-bottom: 8px; }
.host-cat-status.answering h2 { font-size: 18px; }
.host-cat-status.answering p { font-size: 16px; }
.host-cat-status.answering .drawn-name { width: 100px; height: 28px; }

/* Итоги на телефоне: раздел занимает доступный холст игры. */
.player-mode .player > .round-summary { display: flex; flex: 1 1 0; flex-direction: column; min-height: 0; padding: 0; overflow: visible; gap: 8px; }
.player-mode .player .round-summary > h2 { flex: none; margin: 0; font-size: clamp(16px, 3vw, 24px); }

/* Avoid percentage-height flex children collapsing in mobile WebKit. */
.shell.player-mode > .effects-control { flex: none; }
.shell.player-mode > div:has(.player) { flex: 1 1 0; }
.shell.player-mode .player, .shell.player-mode .player.compact { flex: 1 1 0; height: auto; }

.shell.player-mode:has(.round-summary:not([hidden])) {
  width: 100%; max-width: none; margin-inline: 0; align-items: stretch; justify-content: flex-start;
  padding-inline: max(12px, env(safe-area-inset-left)) max(12px, env(safe-area-inset-right));
}
.shell.player-mode:has(.round-summary:not([hidden])) > div:has(.player),
.shell.player-mode:has(.round-summary:not([hidden])) .player,
.shell.player-mode:has(.round-summary:not([hidden])) .round-summary { width: 100%; max-width: none; align-self: stretch; }

@media (min-width: 700px) and (min-height: 400px) {
  .player-mode .player > .round-summary { flex: 1 1 0; gap: clamp(8px, 1.5vh, 16px); }
  .player-mode .player .round-summary > h2 { font-size: clamp(26px, 3vw, 40px); line-height: 1.1; }
}
@media (orientation: landscape) and (max-width: 700px) and (max-height: 600px) {
  .player-mode .player > .round-summary { width: 100%; box-sizing: border-box; overflow: hidden; gap: 3px; }
  .player-mode .player .round-summary > h2 { font-size: 14px; line-height: 1; }
  .player-mode .player > .rate-pack { flex: none; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; justify-items: center; gap: 0 6px; width: 100%; max-height: 22px; margin: 0; overflow: hidden; }
  .player-mode .player > .rate-pack h3 { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
  .player-mode .player > .rate-pack .stars { gap: 0; }
  .player-mode .player > .rate-pack .star { width: 20px; height: 20px; padding: 2px; }
  .player-mode .player > .rate-pack > .note { display: none; }
  .shell.player-mode:has(.round-summary:not([hidden])) { padding: 4px max(8px, env(safe-area-inset-right)) 4px max(8px, env(safe-area-inset-left)); gap: 2px; }
  .shell.player-mode:has(.round-summary:not([hidden])) > .effects-control { grid-template-columns: minmax(0, 1fr) repeat(3, 28px); gap: 4px; height: 28px; min-height: 28px; }
  .shell.player-mode:has(.round-summary:not([hidden])) > .effects-control > button { width: 28px; min-width: 28px; height: 28px; min-height: 28px; padding: 4px; }
  .shell.player-mode:has(.round-summary:not([hidden])) > .effects-control > button .icon { width: 20px; height: 20px; }
  .shell.player-mode:has(.round-summary:not([hidden])) .player-header-identity { gap: 4px; min-height: 26px; }
  .shell.player-mode:has(.round-summary:not([hidden])) .player-header-identity h2 { font-size: 11px; line-height: 1; }
  .shell.player-mode:has(.round-summary:not([hidden])) .player-header-identity .drawn-name { width: auto; height: 26px; max-height: 26px; }
  .shell.player-mode:has(.round-summary:not([hidden])) .player-header-identity .player-points .score { font-size: 16px; }
  .shell.player-mode:has(.round-summary:not([hidden])) .player-header-identity .player-points span { font-size: 9px; }
  .shell.player-mode:has(.round-summary:not([hidden])) .rate-pack .star { width: 20px; min-width: 20px; height: 20px; min-height: 20px; padding: 2px; }
}

/* Итоги на телефоне: подпись под заголовком. */
.player-mode .player .results-caption { flex: none; margin: 0; color: var(--color-muted); font-size: 12px; line-height: 1.2; }

/* Metadata and timer share a real layout row, including the answer showcase. */
.question-card > .question-meta,
.player-mode .player .question-card > .question-meta,
.host-stage .host-question > .question-meta {
  display: flex; flex-wrap: nowrap; align-items: center; justify-content: flex-start;
  grid-column: 1 / -1; width: 100%; max-width: none; min-width: 0; min-height: 0;
  margin: 0; padding: 0 0 8px; gap: 8px; text-align: left;
  border-bottom: 1px solid #ffffff12; align-self: stretch;
}
.question-meta > .theme-name { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.question-meta > .price { flex: none; }
.question-card .question-meta > .timer-wrap { position: static; flex: none; margin: 0; }
.question-meta > .timer-wrap:empty { display: none; }
.player-mode .player .question-card { padding-inline: 12px; }
.player-mode .player .question-meta .answer-timer { --timer-size: 44px; }
.player-mode .player .question-meta .timer-expired { width: 58px; font-size: 12px; }

/* A manually scrollable participant strip directly below the phone header. */
.player-mode .player-score-ticker {
  flex: 0 0 44px; height: 44px; min-height: 44px; width: 100%; max-width: 100%;
  overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; scrollbar-color: #7775b5 transparent;
  overscroll-behavior-x: contain; border-bottom: 1px solid #ffffff12;
}
.player-score-ticker-track { height: 100%; width: max-content; min-width: 0; gap: 8px; animation: none; }
.player-score-ticker-item { height: 100%; flex: none; gap: 8px; padding: 3px 8px; border: 1px solid transparent; border-radius: 10px; }
.player-score-ticker-item.me { border-color: #d7bc6480; }
.player-score-ticker-item.picker { background: #d7bc6418; }
.player-ticker-name { display: flex; align-items: center; justify-content: center; width: 80px; min-width: 0; overflow: hidden; font-size: 13px; }
.player-ticker-name .drawn-name { width: 80px; height: 34px; max-height: 34px; }
.player-ticker-name .face-photo { width: 34px; height: 34px; object-fit: cover; border-radius: 50%; }
.player-score-ticker-item strong { font-size: 18px; line-height: 1; }
.player-header-identity .face-photo { width: 40px; height: 40px; object-fit: cover; }
.host-stage .host-question > .question-content { justify-content: flex-start; gap: 6px; }
.host-stage .host-question > .host-answer-panel { padding-top: 0; align-content: start; gap: 6px; }
.host-question .host-answer-panel > .holder { order: 1; }

/* Separate the retained question (including choices/media) from its answer. */
:is(.tv-mode, .player-mode) .reveal-card:not(.answer-show) > .reveal-answer {
  width: 100%; border-top: 1px solid #ffffff26;
  padding-top: clamp(10px, 1.5vh, 20px);
}
.player-mode .player-board { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); }
.player-mode .player .question-content:has(video, .external-video),
.player-mode .player:has(.buzz:not([hidden])) .question-content:has(video, .external-video) { overflow-y: auto; justify-content: flex-start; }
.player-mode .question-media video { max-height: 32dvh; flex: none; }

/* Короткий ландшафт телефона (844x390): в 260px по высоте честно уместить
   шапку, карточку и кнопку нельзя — вместо вписывания разрешаем вертикальный
   скролл документа только в этой ветке и снимаем flex-зажим. Портрет и
   десктоп не затрагиваются. */
@media (orientation: landscape) and (max-height: 360px) {
  html:has(.shell.player-mode),
  body:has(.shell.player-mode) { height: auto; overflow-y: auto; }
  .shell.player-mode,
  .shell.player-mode:has(.player .buzz:not([hidden])) {
    height: auto; min-height: 100dvh; max-height: none;
    overflow: visible; gap: 6px;
    padding-top: calc(8px + env(safe-area-inset-top));
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
  }
  .shell.player-mode > div:has(.player),
  .shell.player-mode .route-page > .seat-live-wrap:not([hidden]) {
    flex: none; min-height: 0;
  }
  .player-mode .player,
  .player-mode .player:has(.buzz:not([hidden])) { flex: none; height: auto; max-height: none; overflow: visible; }
  /* Селекторы повторяют старые ветки с :has (строки ~1724-1755): иначе их
     специфичность 0,4,0–0,6,0 перебивает этот фолбэк. */
  .player-mode .player .question-card,
  .player-mode .player:has(.buzz:not([hidden])) .question-card,
  .player-mode .player:has(.buzz:not([hidden])):has(.question-with-choices) .question-card {
    flex: none; max-height: none; min-height: 0; overflow: visible; padding: 10px; gap: 6px;
  }
  .player-mode .player .question-content,
  .player-mode .player:has(.buzz:not([hidden])) .question-content,
  .player-mode .player:has(.buzz:not([hidden])):has(.question-with-choices) .question-content {
    overflow: visible; gap: 6px;
  }
  .player-mode .player:has(.buzz:not([hidden])) .buzz,
  .player-mode .player:has(.buzz:not([hidden])):has(.question-with-choices) .buzz {
    flex: none; min-height: 56px; padding-block: 10px;
    font-size: clamp(24px, 6vw, 32px);
  }
  .player-mode .cat-pass-actions .press { min-height: 44px; }
}

@media (max-width: 700px) {
  .host-lobby { height: 100%; overflow: hidden; grid-template-rows: max-content max-content minmax(0, 1fr); }
  .host-lobby .player-canvas {
    min-height: 0; height: 100%; overflow-y: auto; overflow-x: hidden;
    grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: none;
    grid-auto-rows: 104px; align-content: start; gap: 8px; padding: 4px;
    overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #7775b5 #ffffff08;
  }
  .host-lobby .player-canvas::-webkit-scrollbar { width: 5px; }
  .host-lobby .player-canvas::-webkit-scrollbar-track { background: #ffffff08; border-radius: 8px; }
  .host-lobby .player-canvas::-webkit-scrollbar-thumb { background: #7775b5; border-radius: 8px; }
  .host-lobby .player-canvas .bubble { min-height: 104px; height: 104px; padding: 8px 28px 8px 8px; gap: 4px; }
  .host-lobby .bubble .drawn-name { width: 100%; height: 52px; max-height: 52px; }
  .host-lobby .bubble .face-photo { width: 52px; height: 52px; flex: none; }
}
@media (max-width: 700px) and (max-height: 700px) {
  .host-mobile-bar { padding-block: 5px; gap: 6px; }
  .host-mobile-bar .host-round-title { font-size: 15px; }
  .host-mobile-bar .find-metric { min-height: 22px; gap: 3px; padding: 1px 4px; }
  .host-mobile-bar .find-metric-label { font-size: 9px; }
  .host-mobile-bar .find-metric b { min-width: 18px; font-size: 11px; padding: 0 4px; }
  .host-lobby .mobile-host-invite { padding: 10px; border-radius: 16px; }
  .host-lobby .card-kicker { font-size: 8px; margin-bottom: 6px; letter-spacing: 1px; }
  .host-lobby .invite-grid { grid-template-columns: 80px minmax(0, 1fr); gap: 10px; }
  .host-lobby .qr-frame { padding: 6px; border-radius: 10px; }
  .host-lobby .invite-details h1 { font-size: 17px; }
  .host-lobby .invite-details p { font-size: 10px; margin-bottom: 5px; }
  .host-lobby .small-label { font-size: 8px; }
  .host-lobby .share-invite { min-height: 32px; padding: 4px 8px; font-size: 16px; }
  .host-lobby .share-button { min-height: 28px; padding: 4px; font-size: 10px; }
  .host-lobby .players-head h2 { font-size: 16px; }
}

/* Узкий вход 320px: клавиатура слова и строки формы должны ужаться в контент, иначе крайние кнопки торчат за вьюпорт. Блок в конце файла, чтобы перекрывать базовые flex-правила выше. */
@media (max-width: 360px) {
  .key-row { gap: 4px; }
  .keys .key { min-width: 0; width: 100%; }
  .join-form, .player-setup,
  .join-form > .row, .join-form .name-mode { min-width: 0; max-width: 100%; }
  .join-form > .row button, .join-form .name-mode .press { min-width: 0; flex: 1 1 0; }
}
