/* Экран игрока. Всё живёт на телефоне: большого экрана в v2 нет.
   Главное ограничение — до 30 игроков, поэтому нигде нет списков,
   растущих вместе с числом участников. Только агрегаты. */

.app {
  height: 100dvh; /* dvh, а не vh: иначе нижний ряд уезжает под панель Safari */
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
}

.pscreen {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: max(14px, env(safe-area-inset-top)) 14px max(14px, env(safe-area-inset-bottom));
  overflow-y: auto;
  animation: pscreen-in 0.26s ease;
}

.pscreen--center {
  align-items: center;
  justify-content: center;
  text-align: center;
}

@keyframes pscreen-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

/* ── Общие элементы ────────────────────────────────────────────────── */

.logo {
  margin: 0;
  font-size: clamp(38px, 13vw, 60px);
  font-weight: 900;
  line-height: 0.94;
  letter-spacing: -0.03em;
  background: linear-gradient(120deg, #fff 10%, var(--neon) 55%, var(--neon-2) 95%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.logo span {
  display: block;
}

.logo__sub {
  margin: 6px 0 22px;
  color: var(--text-dim);
  font-size: 15px;
  font-weight: 600;
}

.bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.bar h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-back {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 24px;
  line-height: 1;
  padding: 0 0 3px;
}

.btn-mini {
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--line);
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 700;
}

.btn-mini--wide {
  width: 100%;
  padding: 11px;
  margin-top: 10px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(20px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 200;
  max-width: 90%;
  padding: 12px 20px;
  border-radius: 999px;
  background: rgba(232, 56, 79, 0.95);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  animation: toast-in 0.22s ease;
}

.toast--ok {
  background: rgba(39, 174, 96, 0.95);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translate(-50%, 14px);
  }
}

/* ── Главная ───────────────────────────────────────────────────────── */

.home__actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(340px, 100%);
}

.home__rooms {
  width: min(420px, 100%);
  margin-top: 26px;
  text-align: left;
}

.home__roomshead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.home__roomshead h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-dim);
}

.roomlist {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 34dvh;
  overflow-y: auto;
}

.roomlist__empty {
  padding: 18px 4px;
  color: var(--text-faint);
  font-size: 14px;
  font-weight: 600;
  text-align: center;
}

.roomcard {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius);
  background: var(--bg-card);
  border: 1px solid var(--line);
  text-align: left;
  width: 100%;
  transition: border-color 0.15s ease, transform 0.1s ease;
}

.roomcard:active {
  transform: scale(0.985);
  border-color: var(--neon);
}

.roomcard__main {
  flex: 1;
  min-width: 0;
}

.roomcard__title {
  font-size: 16px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.roomcard__sub {
  margin-top: 3px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-faint);
}

.roomcard__lock {
  font-size: 15px;
  opacity: 0.7;
}

/* ── Формы ─────────────────────────────────────────────────────────── */

.form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: min(400px, 100%);
  margin: 10px auto 0;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.field > span {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.field b {
  color: var(--neon-2);
  font-family: var(--font-num);
}

.input {
  width: 100%;
  padding: 16px 18px;
  border-radius: var(--radius);
  background: var(--bg-card);
  border: 2px solid var(--line);
  color: var(--text);
  /* 16px — минимум, при котором Safari не зумит страницу при фокусе */
  font-size: 17px;
  font-weight: 700;
  outline: none;
  transition: border-color 0.18s ease;
}

.input:focus {
  border-color: var(--neon);
}

.input::placeholder {
  color: var(--text-faint);
  font-weight: 600;
}

.input--code {
  text-align: center;
  font-family: var(--font-num);
  font-size: 26px;
  letter-spacing: 0.32em;
  text-indent: 0.32em;
  text-transform: uppercase;
}

.range {
  width: 100%;
  accent-color: var(--neon);
}

.check {
  display: flex;
  align-items: center;
  gap: 11px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-dim);
}

.check input {
  width: 22px;
  height: 22px;
  accent-color: var(--neon);
  flex-shrink: 0;
}

/* ── Лобби ─────────────────────────────────────────────────────────── */

.code-card {
  flex-shrink: 0;
  padding: 18px;
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  border: 1px solid var(--line);
  text-align: center;
}

.code-card__label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.code-card__code {
  margin-top: 6px;
  font-family: var(--font-num);
  font-size: clamp(34px, 11vw, 46px);
  font-weight: 800;
  letter-spacing: 0.16em;
  text-indent: 0.16em;
  color: var(--neon-2);
}

.lobby__meta {
  display: flex;
  justify-content: space-between;
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-dim);
}

/* Сетка вместо списка: 30 игроков должны поместиться без бесконечной прокрутки */
.playergrid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 8px;
  align-content: start;
  overflow-y: auto;
  min-height: 0;
}

.pchip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 12px;
  border-radius: 999px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  font-size: 14px;
  font-weight: 700;
  animation: chip-in 0.3s cubic-bezier(0.2, 1.4, 0.4, 1);
}

@keyframes chip-in {
  from {
    opacity: 0;
    transform: scale(0.75);
  }
}

.pchip__name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pchip--owner {
  border-color: var(--gold);
}

.pchip--me {
  background: rgba(124, 92, 255, 0.2);
  border-color: var(--neon);
}

.pchip--offline {
  opacity: 0.4;
}

.pchip__kick {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(232, 56, 79, 0.9);
  color: #fff;
  font-size: 12px;
  line-height: 20px;
  padding: 0;
  text-align: center;
}

.lobby__foot {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.hint-line {
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-faint);
}

/* ── Таймер ────────────────────────────────────────────────────────── */

.timerbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  z-index: 5;
}

.timerbar i {
  display: block;
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, var(--neon), var(--neon-2));
  transform-origin: left center;
  /* Ширину двигает JS каждый кадр, поэтому переход не нужен */
}

.timerbar i.is-low {
  background: linear-gradient(90deg, #ff9f43, var(--bad));
}

/* ── Голосование за тему ───────────────────────────────────────────── */

.vote__title {
  margin: 18px 0 0;
  text-align: center;
  font-size: 26px;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.vote__sub {
  margin: 4px 0 10px;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-dim);
}

.themegrid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  min-height: 0;
}

/* На экране ответа темы идут столбиком: в две колонки длинные названия
   («Технологии», «Литература») не влезали и переносились с дефисом,
   а свободная высота там всё равно есть. */
.themegrid--compact {
  flex: 0 0 auto;
  grid-template-columns: 1fr;
  gap: 7px;
}

.theme {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 14px 10px;
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  border: 2px solid var(--line);
  color: var(--text);
  font-weight: 800;
  transition: transform 0.12s cubic-bezier(0.2, 1.5, 0.4, 1), border-color 0.15s ease, background 0.15s ease;
}

.themegrid--compact .theme {
  flex-direction: row;
  justify-content: flex-start;
  gap: 9px;
  padding: 11px 13px;
  border-radius: var(--radius);
}

.theme:active {
  transform: scale(0.95);
}

.theme__emoji {
  font-size: 30px;
  line-height: 1;
}

.themegrid--compact .theme__emoji {
  font-size: 20px;
}

.theme__title {
  font-size: 15px;
  line-height: 1.15;
  text-align: center;
  /* break-word, а не anywhere: anywhere рвал «Литературу» посередине слова
     даже когда места хватало. Длинное слово переносится только если
     иначе никак. */
  overflow-wrap: break-word;
  hyphens: auto;
}

.themegrid--compact .theme__title {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  text-align: left;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.theme__votes {
  min-width: 24px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  font-family: var(--font-num);
  font-size: 13px;
}

.theme--picked {
  border-color: var(--neon);
  background: rgba(124, 92, 255, 0.22);
}

/* Победившая тема на пару секунд перед вопросом: она одна остаётся яркой,
   остальные гаснут — видно, куда ушла игра, даже краем глаза. */
.theme--winner {
  border-color: var(--neon-2);
  background: rgba(0, 224, 198, 0.2);
  box-shadow: 0 0 0 2px rgba(0, 224, 198, 0.35), 0 8px 24px rgba(0, 224, 198, 0.18);
  animation: winner-pulse 0.45s cubic-bezier(0.2, 1.4, 0.4, 1);
}

.theme--winner .theme__votes {
  background: var(--neon-2);
  color: #04221f;
}

.theme--lost {
  opacity: 0.4;
  filter: grayscale(0.5);
}

@keyframes winner-pulse {
  from {
    transform: scale(0.94);
  }
  60% {
    transform: scale(1.06);
  }
}

/* Проголосовал — кнопки перестают реагировать: голос окончательный. */
.theme:disabled {
  cursor: default;
}

.theme:disabled:active {
  transform: none;
}

.theme--picked:disabled {
  opacity: 1;
}

.vote__count {
  flex-shrink: 0;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-faint);
  transition: color 0.2s ease;
}

.vote__count--winner {
  font-size: 15px;
  color: var(--neon-2);
}

/* ── Вопрос ────────────────────────────────────────────────────────── */

.qhead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-dim);
}

.qhead b {
  color: var(--text);
  font-family: var(--font-num);
}

.qhead__theme {
  flex: 1;
  min-width: 0;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.qhead__timer {
  min-width: 34px;
  text-align: right;
  font-family: var(--font-num);
  font-size: 19px;
  font-weight: 800;
  color: var(--neon-2);
}

.qhead__timer.is-low {
  color: var(--bad);
  animation: tick 1s ease-in-out infinite;
}

@keyframes tick {
  50% {
    transform: scale(1.15);
  }
}

.qbody {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  max-height: 42dvh;
  overflow-y: auto;
}

.qbody__text {
  margin: 0;
  font-size: clamp(17px, 5vw, 23px);
  font-weight: 800;
  line-height: 1.22;
  text-align: center;
  text-wrap: balance;
}

.qbody__media {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.qbody__image {
  max-height: 21dvh;
  max-width: 100%;
  object-fit: contain;
  border-radius: 14px;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.45);
}

.qbody__audio {
  width: 100%;
  max-width: 320px;
}

.pad {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  min-height: 0;
}

.pad.is-two {
  grid-template-columns: 1fr;
}

.pad__btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 10px;
  border-radius: var(--radius-lg);
  background: var(--opt);
  color: #fff;
  font-size: 19px;
  font-weight: 800;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.35);
  transition: transform 0.12s cubic-bezier(0.2, 1.5, 0.4, 1), opacity 0.25s ease, filter 0.25s ease;
}

.pad__btn:active {
  transform: scale(0.94);
}

.pad__shape {
  font-size: 22px;
  line-height: 1;
  opacity: 0.9;
}

.pad__label {
  font-size: clamp(14px, 4.2vw, 18px);
  line-height: 1.2;
  text-align: center;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.pad--locked .pad__btn {
  opacity: 0.25;
  filter: grayscale(0.7);
  pointer-events: none;
}

.pad--locked .pad__btn.is-picked {
  opacity: 1;
  filter: none;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.85), 0 10px 30px rgba(0, 0, 0, 0.45);
  animation: picked 1.6s ease-in-out infinite;
}

@keyframes picked {
  50% {
    transform: scale(1.03);
  }
}

/* Замена вибрации: на iPhone Vibration API не работает, отклик визуальный */
.pad__btn.is-flash {
  animation: flash 0.3s ease;
}

@keyframes flash {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.9);
  }
  100% {
    box-shadow: 0 0 0 26px rgba(255, 255, 255, 0);
  }
}

.qfoot {
  flex-shrink: 0;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-faint);
  min-height: 17px;
}

/* ── Показ ответа ──────────────────────────────────────────────────── */

.verdict {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  margin-top: 6px;
  border-radius: var(--radius);
  background: var(--bg-card);
  border: 1px solid var(--line);
}

.verdict--ok {
  border-color: var(--ok);
  background: rgba(39, 174, 96, 0.15);
}

.verdict--bad {
  border-color: var(--bad);
  background: rgba(232, 56, 79, 0.13);
}

.verdict__icon {
  font-size: 30px;
  line-height: 1;
}

.verdict__text {
  flex: 1;
  font-size: 19px;
  font-weight: 900;
}

.verdict__delta {
  font-family: var(--font-num);
  font-size: 19px;
  font-weight: 800;
  color: var(--gold);
}

.verdict__right {
  flex-shrink: 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-dim);
  text-align: center;
}

.verdict__right b {
  color: var(--ok);
}

.verdict__expl {
  flex-shrink: 0;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.45;
  color: var(--text-dim);
  text-align: center;
}

/* Гистограмма: ровно столько строк, сколько вариантов, независимо
   от числа игроков. Имена раскрываются по тапу. */
/* Не растягиваем на всю высоту: при двух вариантах это оставляло
   дыру в пол-экрана. Гистограмма живёт под вердиктом, голосование
   прижато к низу — туда дотягивается большой палец. */
.stats {
  flex: 0 1 auto;
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-height: 0;
  overflow-y: auto;
}

.statrow {
  border-radius: 12px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  overflow: hidden;
}

.statrow--correct {
  border-color: var(--ok);
}

.statrow__main {
  position: relative;
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 11px 13px;
  background: none;
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  text-align: left;
}

/* Полоса-заливка рисуется под текстом, поэтому текст всегда читается */
.statrow__bar {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  background: var(--opt);
  opacity: 0.22;
  transition: width 0.5s cubic-bezier(0.2, 0.9, 0.3, 1);
}

.statrow--correct .statrow__bar {
  opacity: 0.34;
}

.statrow__shape {
  position: relative;
  color: var(--opt);
  font-size: 15px;
}

.statrow__text {
  position: relative;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.statrow__count {
  position: relative;
  font-family: var(--font-num);
  font-size: 15px;
}

.statrow__chev {
  position: relative;
  font-size: 11px;
  color: var(--text-faint);
  transition: transform 0.2s ease;
}

.statrow.is-open .statrow__chev {
  transform: rotate(180deg);
}

.statrow__names {
  padding: 0 13px 11px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dim);
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.revote {
  flex-shrink: 0;
  margin-top: auto;
  padding-top: 10px;
}

.revote__head {
  margin-bottom: 7px;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-faint);
  text-align: center;
}

/* ── Финал ─────────────────────────────────────────────────────────── */

.confetti {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.final__title {
  flex-shrink: 0;
  margin: 8px 0 0;
  text-align: center;
  font-size: 28px;
  font-weight: 900;
  letter-spacing: -0.02em;
  background: linear-gradient(120deg, var(--gold), #fff 60%, var(--neon-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  z-index: 1;
}

.podium {
  flex-shrink: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 8px;
  z-index: 1;
}

.pod {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex: 1;
  max-width: 112px;
  padding: 12px 8px;
  border-radius: var(--radius) var(--radius) 6px 6px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  animation: pod-in 0.5s backwards cubic-bezier(0.2, 1.3, 0.4, 1);
}

@keyframes pod-in {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
}

.pod--1 {
  height: 150px;
  border-color: var(--gold);
  background: linear-gradient(180deg, rgba(255, 209, 102, 0.22), var(--bg-card));
  animation-delay: 0.4s;
}

.pod--2 {
  height: 120px;
  animation-delay: 0.2s;
}

.pod--3 {
  height: 100px;
  animation-delay: 0.05s;
}

.pod__medal {
  font-size: 26px;
}

.pod__name {
  font-size: 13px;
  font-weight: 800;
  text-align: center;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.pod__score {
  font-family: var(--font-num);
  font-size: 13px;
  font-weight: 700;
  color: var(--neon-2);
}

.final__me {
  flex-shrink: 0;
  text-align: center;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-dim);
  z-index: 1;
}

.final__me b {
  color: var(--neon-2);
  font-family: var(--font-num);
}

.board {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-height: 0;
  overflow-y: auto;
  z-index: 1;
}

.brow {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 14px;
  border-radius: 12px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  font-size: 14px;
  font-weight: 700;
}

.brow--me {
  border-color: var(--neon);
  background: rgba(124, 92, 255, 0.16);
}

.brow__place {
  font-family: var(--font-num);
  color: var(--text-faint);
  min-width: 1.8em;
}

.brow__name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brow__score {
  font-family: var(--font-num);
  color: var(--neon-2);
}

.final__actions {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 1;
}

/* ── Возврат в недоигранную партию ─────────────────────────────────── */

.returncard {
  display: flex;
  align-items: center;
  gap: 12px;
  width: min(340px, 100%);
  margin-bottom: 14px;
  padding: 14px 18px;
  border-radius: var(--radius);
  background: linear-gradient(120deg, rgba(0, 224, 198, 0.18), rgba(124, 92, 255, 0.14));
  border: 1px solid var(--neon-2);
  color: var(--text);
  text-align: left;
  animation: chip-in 0.35s cubic-bezier(0.2, 1.4, 0.4, 1);
}

.returncard__text {
  flex: 1;
  min-width: 0;
  font-size: 15px;
  font-weight: 800;
}

.returncard__text b {
  display: block;
  margin-top: 2px;
  font-size: 13px;
  font-weight: 600;
  color: var(--neon-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.returncard__arrow {
  font-size: 22px;
  color: var(--neon-2);
}

/* ── Выбор тем при создании ────────────────────────────────────────── */

.btn-inline {
  padding: 2px 9px;
  margin-left: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--line);
  color: var(--text-dim);
  font-size: 11px;
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0;
}

.themepicker {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 34dvh;
  overflow-y: auto;
  padding: 6px;
  border-radius: var(--radius);
  background: var(--bg-card);
  border: 1px solid var(--line);
}

.themerow {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 10px;
  background: none;
  border: none;
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
  text-align: left;
  width: 100%;
}

.themerow__box {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 2px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: transparent;
}

.themerow.is-on .themerow__box {
  background: var(--neon);
  border-color: var(--neon);
  color: #fff;
}

.themerow__emoji {
  flex-shrink: 0;
  font-size: 17px;
}

.themerow__title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.themerow__count {
  flex-shrink: 0;
  font-family: var(--font-num);
  font-size: 12px;
  color: var(--text-faint);
}

.themerow:not(.is-on) {
  opacity: 0.5;
}

.field__warn {
  padding: 9px 12px;
  border-radius: 10px;
  background: rgba(232, 56, 79, 0.12);
  border: 1px solid rgba(232, 56, 79, 0.4);
  color: #ffb3bd;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
}

/* ── Кнопка выхода ─────────────────────────────────────────────────── */

.quit {
  position: fixed;
  left: 10px;
  top: max(10px, env(safe-area-inset-top));
  z-index: 60;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--line);
  color: var(--text-faint);
  font-size: 13px;
  line-height: 1;
  padding: 0;
  opacity: 0.55;
  transition: opacity 0.15s ease, color 0.15s ease;
}

.quit:active {
  opacity: 1;
  color: var(--bad);
}

/* Шапка вопроса начинается правее кнопки выхода, иначе они наезжают. */
.pscreen--roomed .qhead,
.pscreen--roomed .vote__title {
  padding-left: 34px;
}

/* ── Лента текущего топа ───────────────────────────────────────────── */

.topstrip {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  overflow-x: auto;
  padding: 8px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  scrollbar-width: none;
}

.topstrip::-webkit-scrollbar {
  display: none;
}

.topstrip__item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}

.topstrip__item b {
  font-family: var(--font-num);
  color: var(--neon-2);
  font-weight: 700;
}

.topstrip__me {
  color: var(--neon);
}

.topstrip__me b {
  color: var(--neon);
}

.topstrip__sep {
  color: var(--text-faint);
  flex-shrink: 0;
}

/* ── Своё окно подтверждения ───────────────────────────────────────── */
/* Нативный confirm() браузер может подавить навсегда («не показывать
   больше диалоги»), и кнопка перестаёт работать без единого признака. */

.modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(6, 6, 14, 0.78);
  backdrop-filter: blur(4px);
  animation: modal-in 0.18s ease;
}

@keyframes modal-in {
  from {
    opacity: 0;
  }
}

.modal__box {
  width: min(360px, 100%);
  padding: 22px;
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  border: 1px solid var(--line);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
  animation: modal-pop 0.22s cubic-bezier(0.2, 1.3, 0.4, 1);
}

@keyframes modal-pop {
  from {
    transform: scale(0.92);
    opacity: 0;
  }
}

.modal__title {
  font-size: 20px;
  font-weight: 900;
  letter-spacing: -0.01em;
}

.modal__text {
  margin-top: 8px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.45;
  color: var(--text-dim);
}

.modal__actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.modal__actions button {
  flex: 1;
  padding: 14px 10px;
  font-size: 16px;
}
