/* ==========================================================================
   Экраны: загрузка, лобби, стол, магазин, профиль, достижения и прочее.
   ========================================================================== */

/* ---------------------------------------------------------------- загрузка */

.boot {
  /* Отдельный слой поверх экрана: первый экран рисуется под ним */
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  align-content: center;
  gap: var(--gap-5);
  text-align: center;
  background-color: var(--bg);
  background-image:
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 4px),
    repeating-linear-gradient(-45deg, rgba(0, 0, 0, 0.06) 0 1px, transparent 1px 4px);
  transition:
    opacity 320ms cubic-bezier(0.23, 1, 0.32, 1),
    transform 320ms cubic-bezier(0.23, 1, 0.32, 1);
}

/* Уход заставки: растворяется и чуть отдаляется — экран уже под ней */
.boot.is-leaving {
  opacity: 0;
  transform: scale(1.03);
  pointer-events: none;
}

/* Карта крутится в 3D, пока ждём сервер (образец владельца 27.10.2026):
   с обеих сторон самолётик в духе значка Telegram: голубая карта с белым
   значком и наоборот — белая с голубым. Чистая CSS-анимация:
   она идёт вне главного потока и не дёргается, пока грузится приложение */
.boot-flip {
  position: relative;
  width: 150px;
  height: 214px;
  /* Повёрнутая карта шире своей коробки — место под надписью */
  margin-bottom: 22px;
  perspective: 900px;
}

/* Переворот как в мультфильме (просьба владельца 27.10.2026): замах назад,
   подброс с вращением, перелёт и мягкая посадка, пауза — и обратно. Тень на
   сукне и блик по карте идут в такт. Цикл — 3,6 с, всё на CSS: анимация живёт
   вне главного потока и не дёргается, пока приложение грузится */
.boot-flip__card {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  animation: boot-flip 3.6s infinite;
}

/* Тень лежит на сукне: сужается, когда карта встаёт ребром, и расплывается,
   когда та взлетает */
.boot-flip__shadow {
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: -18px;
  height: 26px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.45);
  filter: blur(10px);
  animation: boot-flip-shadow 3.6s infinite;
}

.boot-flip__face {
  position: absolute;
  inset: 0;
  border-radius: 16px;
  background: linear-gradient(170deg, #ffffff 0%, #eef1fb 55%, #d9e0f5 100%);
  box-shadow: 0 18px 36px -12px rgba(0, 0, 0, 0.55), inset 0 0 0 1px rgba(0, 0, 0, 0.06);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

/* Блик скользит по карте, пока она поворачивается */
.boot-flip__face::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(
    105deg,
    transparent 35%,
    rgba(255, 255, 255, 0.55) 48%,
    transparent 62%
  );
  background-size: 300% 100%;
  background-position: 120% 0;
  animation: boot-flip-sheen 3.6s infinite;
  pointer-events: none;
}

.boot-flip__face--front {
  display: grid;
  place-items: center;
  background: linear-gradient(160deg, #37b6f2 0%, #1f8fd8 60%, #1878c4 100%);
}

.boot-flip__face--back {
  transform: rotateY(180deg);
  display: grid;
  place-items: center;
}

/* Значок по центру — крупно, без круга (просьба владельца 27.10.2026) */
.boot-flip__badge {
  display: grid;
  place-items: center;
}

.boot-flip__badge svg {
  width: 84px;
  height: 84px;
}

.boot-flip__pip {
  position: absolute;
  display: block;
}

.boot-flip__pip svg {
  display: block;
  width: 100%;
  height: 100%;
}

.boot-flip__pip--tl {
  top: 14px;
  left: 14px;
  width: 30px;
  height: 30px;
}

.boot-flip__pip--br {
  right: 14px;
  bottom: 14px;
  width: 30px;
  height: 30px;
  transform: rotate(180deg);
}

/* Половина цикла — один переворот: замах (0–9 %), подброс с вращением
   (9–30 %), перелёт и посадка (30–40 %), пауза; вторая половина — обратно */
@keyframes boot-flip {
  0% {
    transform: rotateZ(-14deg) translateY(0) rotateY(0deg) scale(1);
    animation-timing-function: cubic-bezier(0.45, 0, 0.55, 1);
  }
  9% {
    transform: rotateZ(-17deg) translateY(5px) rotateY(-16deg) scale(0.97);
    animation-timing-function: cubic-bezier(0.2, 0.7, 0.25, 1);
  }
  30% {
    transform: rotateZ(-9deg) translateY(-34px) rotateY(196deg) rotateX(6deg) scale(1.08);
    animation-timing-function: cubic-bezier(0.3, 0, 0.3, 1);
  }
  40% {
    transform: rotateZ(-14deg) translateY(2px) rotateY(176deg) scale(0.99);
    animation-timing-function: cubic-bezier(0.25, 0.6, 0.35, 1);
  }
  46%,
  50% {
    transform: rotateZ(-14deg) translateY(0) rotateY(180deg) scale(1);
    animation-timing-function: cubic-bezier(0.45, 0, 0.55, 1);
  }
  59% {
    transform: rotateZ(-17deg) translateY(5px) rotateY(164deg) scale(0.97);
    animation-timing-function: cubic-bezier(0.2, 0.7, 0.25, 1);
  }
  80% {
    transform: rotateZ(-9deg) translateY(-34px) rotateY(376deg) rotateX(6deg) scale(1.08);
    animation-timing-function: cubic-bezier(0.3, 0, 0.3, 1);
  }
  90% {
    transform: rotateZ(-14deg) translateY(2px) rotateY(356deg) scale(0.99);
    animation-timing-function: cubic-bezier(0.25, 0.6, 0.35, 1);
  }
  96%,
  100% {
    transform: rotateZ(-14deg) translateY(0) rotateY(360deg) scale(1);
  }
}

@keyframes boot-flip-shadow {
  0%,
  46%,
  50%,
  96%,
  100% {
    transform: scaleX(1);
    opacity: 1;
  }
  9%,
  59% {
    transform: scaleX(1.06);
    opacity: 1;
  }
  20%,
  70% {
    transform: scaleX(0.35);
    opacity: 0.5;
  }
  30%,
  80% {
    transform: scaleX(0.75);
    opacity: 0.35;
  }
  40%,
  90% {
    transform: scaleX(1.04);
    opacity: 0.95;
  }
}

@keyframes boot-flip-sheen {
  0%,
  12%,
  50%,
  62%,
  100% {
    background-position: 120% 0;
  }
  32%,
  82% {
    background-position: -20% 0;
  }
}

/* Меньше движения: карта просто лежит лицом вверх */
@media (prefers-reduced-motion: reduce) {
  .boot-flip__card,
  .boot-flip__shadow,
  .boot-flip__face::after {
    animation: none;
  }

  .boot-flip__card {
    transform: rotateZ(-14deg);
  }
}

/* Подпись заставки — одна строка «Карточный клуб»: крупно, золотом сукна,
   с разрядкой, как вывеска клуба (просьба владельца 27.10.2026) */
.boot__club {
  margin: 0;
  color: #e9c46a;
  font-family: var(--font-display);
  font-size: var(--step-3);
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}

/* ------------------------------------------------------------------ шапка */

.topbar {
  display: flex;
  align-items: center;
  gap: var(--gap-3);
  /* Отступ до контента даёт gap экрана — свой margin делал его двойным */
  margin-bottom: 0;
}

.wallet {
  display: flex;
  align-items: center;
  gap: var(--gap-2);
  padding: 6px var(--gap-3) 6px 6px;
  border-radius: var(--radius-pill);
  background: var(--surface);
  border: 1px solid var(--border);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.wallet__coin {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(160deg, var(--brass-400), var(--brass-600));
  color: var(--accent-ink);
  font-size: var(--step--2);
}

.wallet__locked {
  font-size: var(--step--2);
  color: var(--text-dim);
}

/* --------------------------------------------------------------- навигация */

.tabbar {
  position: sticky;
  bottom: 0;
  z-index: var(--z-header);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--gap-1);
  margin: auto calc(var(--gap-4) * -1) 0;
  padding: var(--gap-2) var(--gap-2) calc(var(--safe-bottom) + var(--gap-2));
  background: color-mix(in srgb, var(--bg) 97%, transparent);
  backdrop-filter: blur(18px);
  border-top: 1px solid var(--border);
}

.tabbar__item {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 2px;
  padding: var(--gap-2) 0;
  border-radius: var(--radius-md);
  font-size: var(--step--2);
  font-weight: 700;
  color: var(--text-dim);
  transition: color var(--dur-fast);
}

.tabbar__item[aria-current="page"] {
  color: var(--accent-soft);
}

.tabbar__icon {
  display: grid;
  place-items: center;
  height: 24px;
}

/* У активной вкладки есть ещё и метка: цвет не должен быть единственным
   признаком состояния — его различают не все */
.tabbar__item[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 2px;
  width: 16px;
  height: 2px;
  border-radius: var(--radius-pill);
  background: currentColor;
  transform: translateX(-50%);
}

/* Сукно стола и карточка лобби тёмные в любой теме, поэтому текст и границы
   на них тоже всегда «ночные»: иначе в светлой теме тёмные надписи ложились
   на тёмно-зелёное и переставали читаться */
.hero,
.table-screen {
  --text: var(--cream-100);
  --text-muted: var(--sage-300);
  --text-dim: rgba(247, 242, 228, 0.62);
  --surface: rgba(255, 255, 255, 0.08);
  --surface-strong: rgba(255, 255, 255, 0.14);
  --border: rgba(242, 206, 126, 0.24);
  --border-strong: rgba(242, 206, 126, 0.42);
  color: var(--text);
}

/* ----------------------------------------------------------- главный экран */

/* Карточка игрока: аватар, рейтинг с полоской и баланс */
.profile-card {
  display: flex;
  align-items: center;
  gap: var(--gap-3);
  padding: var(--gap-3) var(--gap-4);
  border-radius: var(--radius-md);
  background: var(--section-bg);
}

.profile-card__body {
  flex: 1;
  min-width: 0;
}

.profile-card__name {
  font-size: var(--step-0);
  font-weight: 600;
}

.profile-card__rating {
  display: flex;
  justify-content: space-between;
  gap: var(--gap-2);
  font-size: var(--step--1);
  color: var(--hint);
}

.profile-card__wallet {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px var(--gap-3);
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--text) 7%, transparent);
  font-size: var(--step--1);
  font-weight: 600;
  color: var(--text);
}

.profile-card__chips {
  font-variant-numeric: tabular-nums;
}

/* Полоска прогресса до следующей сотни рейтинга */
.meter {
  height: 6px;
  margin-top: 6px;
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--text) 10%, transparent);
  overflow: hidden;
}

.meter__fill {
  display: block;
  height: 100%;
  border-radius: var(--radius-pill);
  background: var(--accent);
}

/* Экраны-списки идут секциями с одинаковым просветом */
.section-block + .section-block {
  margin-top: var(--gap-5);
}

/* ------------------------------------------------------------------ лобби */

/* Шапка экрана: заголовок 17 и кошелёк справа */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gap-3);
  min-height: 40px;
}

.topbar__title {
  font-size: var(--step-0);
  font-weight: 600;
  /* На узком экране длинный заголовок («Достижения») сжимается сам, а не
     выталкивает кошелёк за край: на 320px экран прокручивался вбок */
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wallet {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px var(--gap-3);
  border-radius: var(--radius-pill);
  background: #ffffff;
  font-size: var(--step--1);
  font-weight: 700;
  color: var(--text);
}

.wallet__value {
  font-variant-numeric: tabular-nums;
}

.wallet__locked {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  color: var(--hint);
}

/* Места за столом в строке списка */
.seats {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.seats__free {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1.5px solid var(--separator);
}

.seats__taken .avatar {
  border: 1px solid var(--section-bg);
}

.row-item__value--stake {
  color: var(--text);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* ------------------------------------------------------------------- стол */

/* Экран стола сам является сеткой: шапка, игровое поле, рука.
   Высоту задаёт .screen--table, здесь только растягиваемся по ней. */
.table-screen {
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  /* Колонка ровно по ширине экрана: без этого самый широкий ряд (рука,
     стол) растягивал её шире окна, и шапка с банком уезжала за край */
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
  min-height: 0;
  flex: 1;
  /* Узор сукна — у премиум-столов (звёзды, бархат, блик), у обычных его нет */
  background:
    var(--table-pattern, linear-gradient(transparent, transparent)) 0 0 / var(--table-pattern-size, auto),
    radial-gradient(120% 70% at 50% 34%, var(--table-felt), var(--table-felt-edge) 78%),
    var(--table-felt-edge);
  /* Виньетка по краям: стол собран к центру, свет падает на поле */
  box-shadow: inset 0 0 120px rgba(0, 0, 0, 0.45);
}

.table-top {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gap-2);
  padding: calc(var(--safe-top) + var(--gap-3)) var(--gap-3) var(--gap-2);
}

.table-pot {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.1;
}

/* Правила стола значками в углу шапки: режим, жульничество, ставка */
.table-meta {
  display: flex;
  align-items: center;
  gap: var(--gap-1);
}

.table-meta__mark {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px var(--gap-2);
  border-radius: var(--radius-pill);
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--border);
  font-size: var(--step--2);
  font-weight: 800;
  color: var(--text-muted);
}

.table-meta__mark--bet {
  color: var(--brass-400);
}

.table-meta__mark--ok {
  color: var(--success);
}

.table-meta__mark--warn {
  color: var(--rose-400);
  border-color: rgba(200, 68, 60, 0.45);
}

.table-pot {
  padding: 2px var(--gap-4);
  border-radius: var(--radius-pill);
  background: rgba(0, 0, 0, 0.26);
  border: 1px solid var(--border);
}

.table-pot__row {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.table-pot__value {
  font-family: var(--font-display);
  font-size: var(--step-2);
  font-weight: 700;
  color: var(--brass-400);
}

.table-pot__label {
  font-size: var(--step--2);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.62);
}

.table-mid {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: var(--gap-2);
  min-height: 0;
  padding: 0 var(--gap-3);
}

/* Соперники прижаты к верху, поле с картами занимает остальное место
   и центрируется — привычная раскладка карточного стола */
.table-area {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--gap-3);
  min-height: 0;
  padding-top: var(--gap-2);
}

.table-area .table-mid {
  flex: 1;
}

.opponents {
  display: flex;
  justify-content: center;
  gap: clamp(6px, 3vw, var(--gap-5));
  /* Сверху оставлено место под облачко «Беру» */
  padding: var(--gap-5) var(--gap-3) var(--gap-2);
}

.seat {
  position: relative;
  display: grid;
  justify-items: center;
  gap: var(--gap-1);
  min-width: 64px;
  transition: opacity var(--dur);
}

/* Вышедший смотрит партию: гаснут аватар, ник и веер, но не его выигрыш —
   «+N» за место должен читаться до конца партии */
.seat--out > :not(.seat__win),
.seat--out .avatar-wrap > :not(.seat__win) {
  opacity: 0.4;
}

.seat--out .avatar-wrap {
  opacity: 1;
}

.seat--offline .avatar {
  filter: grayscale(1);
}

.seat__name {
  max-width: 74px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: var(--step--2);
  font-weight: 700;
}

.seat__title {
  font-size: var(--step--2);
  color: var(--title-color);
}

/* Рука соперника: рубашки веером. По их числу решают, подкидывать ли
   дальше, и по нему же ловят жулика — цифра читается заметно хуже */
.seat__cards {
  display: flex;
  align-items: center;
  height: 26px;
  padding-left: 2px;
}

.seat__back {
  width: 19px;
  height: 27px;
  margin-left: -6px;
  border-radius: 3px;
  border: 1px solid var(--back-edge, var(--card-face));
  background-image:
    var(--back-pattern),
    linear-gradient(160deg, var(--back-base), var(--back-base));
  /* Рубашка-картинка растягивается целиком, узор из градиентов мельчит плиткой */
  background-size: var(--back-seat-size), auto;
  background-position: center;
  box-shadow: var(--shadow-sm);
  transform: rotate(calc((var(--index) - 2.5) * 2deg));
}

.seat__back:first-child {
  margin-left: 0;
}

/* Реплика игрока — «Беру». Висит, пока идёт взятие, поэтому оформлена
   как облачко над местом, а не как мелькающая подпись внизу экрана */
.seat__says {
  position: absolute;
  /* Выше значка роли: иначе облачко накрывает щит или меч */
  top: -38px;
  left: 50%;
  transform: translateX(-50%);
  padding: 3px var(--gap-3);
  border-radius: var(--radius-pill);
  background: var(--rose-500);
  color: var(--cream-100);
  font-size: var(--step--2);
  font-weight: 800;
  letter-spacing: 0.04em;
  white-space: nowrap;
  box-shadow: var(--shadow-md);
  animation: says-in var(--dur) var(--ease-spring) both;
}

@keyframes says-in {
  from {
    opacity: 0;
    transform: translate(-50%, 8px) scale(0.8);
  }
}

.seat__more {
  margin-left: var(--gap-2);
  font-size: var(--step--2);
  font-weight: 800;
  color: var(--text);
}

/* Реакция соперника: крупнее и висит дольше — две секунды не хватало,
   чтобы её заметить за картами */
.seat__reaction {
  position: absolute;
  top: -24px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 2.1rem;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.55));
  animation: pop-reaction 4s var(--ease-out) forwards;
  pointer-events: none;
}

@keyframes pop-reaction {
  0% {
    opacity: 0;
    transform: translate(-50%, 8px) scale(0.5);
  }
  9% {
    opacity: 1;
    transform: translate(-50%, -6px) scale(1.15);
  }
  17% {
    transform: translate(-50%, 0) scale(1);
  }
  88% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -22px) scale(0.9);
  }
}

.table-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--gap-2);
  padding: 0 var(--gap-3);
  min-height: 52px;
}

.table-bottom {
  display: grid;
  /* Колонка не шире экрана: иначе рука растягивала её под свои карты,
     нахлёст считался от этой ширины, и крайние карты уезжали за край */
  grid-template-columns: minmax(0, 1fr);
  gap: var(--gap-2);
}

/* Плашка «Ваш ход»: у своего места кольца таймера нет, очередь видно только здесь */
.turn-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--gap-2);
  margin: 0 auto var(--gap-2);
  padding: 4px var(--gap-4);
  width: fit-content;
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  border: 1px solid var(--accent);
  font-size: var(--step--1);
  font-weight: 700;
  animation: turn-pulse 1.6s var(--ease-out) infinite;
}

/* Свой таймер — полоска по низу плашки, тает вместе со временем хода */
.turn-badge {
  position: relative;
  overflow: hidden;
}

.turn-badge::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  height: 3px;
  width: calc(var(--turn, 100) * 1%);
  background: currentColor;
  opacity: 0.5;
  transition: width 0.25s linear;
}

.turn-badge--urgent::after {
  background: var(--danger);
  opacity: 0.9;
}

.turn-badge__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

.turn-badge__timer {
  font-family: var(--font-mono);
  color: var(--text-dim);
}

.turn-badge--urgent {
  border-color: var(--danger);
  background: color-mix(in srgb, var(--danger) 18%, transparent);
  animation-duration: 0.7s;
}

.turn-badge--urgent .turn-badge__dot {
  background: var(--danger);
}

@keyframes turn-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.55;
  }
}

/* Панель реакций — пилюля с эмодзи. По мотивам Uiverse.io (Mayurwaghgpr,
   MIT): нажатый эмодзи подпрыгивает и растёт, над ним всплывает подпись */
.reactions {
  position: absolute;
  left: var(--gap-3);
  right: var(--gap-3);
  bottom: calc(100% + var(--gap-2));
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  padding: 6px;
  border-radius: var(--radius-pill);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  animation: sheet-up var(--dur) var(--ease-out) both;
}

.reactions button {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  max-width: 40px;
  aspect-ratio: 1;
  border-radius: 50%;
  font-size: 1.3rem;
  line-height: 1;
  background: var(--surface);
  transition: transform var(--dur) var(--ease-spring);
}

.reactions button::before {
  content: attr(data-label);
  position: absolute;
  left: 50%;
  top: -26px;
  transform: translateX(-50%) scale(0.8);
  padding: 2px 7px;
  border-radius: 6px;
  background: var(--text);
  color: var(--bg);
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-fast), transform var(--dur-fast) var(--ease-out);
}

.reactions button:active,
.reactions button.is-sent {
  transform: translateY(-14px) scale(1.3);
  z-index: 1;
}

.reactions button:active::before,
.reactions button.is-sent::before {
  opacity: 1;
  transform: translateX(-50%) scale(1);
}

@media (hover: hover) and (pointer: fine) {
  .reactions button:hover {
    transform: translateY(-14px) scale(1.3);
  }
  .reactions button:hover::before {
    opacity: 1;
    transform: translateX(-50%) scale(1);
  }
}

/* Полоса состояния партии («Беру», «Бито», «Время вышло»).
   Живёт прямо над рукой: смотреть в верх экрана, когда все события
   происходят у карт, игроку неудобно */
.table-status {
  justify-self: center;
  padding: 4px var(--gap-4);
  border-radius: var(--radius-pill);
  background: rgba(7, 13, 10, 0.6);
  border: 1px solid var(--border);
  font-size: var(--step--1);
  font-weight: 700;
  white-space: nowrap;
  animation: toast-in var(--dur) var(--ease-spring) both;
}

/* --------------------------------------------------------------- результаты */

.result__crown {
  display: grid;
  place-items: center;
  width: 92px;
  height: 92px;
  margin: 0 auto var(--gap-3);
  border-radius: 50%;
  color: var(--brass-400);
  background: radial-gradient(circle at 36% 30%, var(--table-glow), transparent 70%);
  border: 1px solid var(--border-strong);
}

/* Выигрыш крупно: ради этой цифры партию и играли */
.result__prize {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--gap-2);
  margin-top: var(--gap-3);
  font-family: var(--font-display);
  font-size: var(--step-3);
  font-weight: 900;
  color: var(--game-gold);
}

.result__row {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  gap: var(--gap-3);
  padding: var(--gap-3);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.result__place {
  font-family: var(--font-display);
  font-size: var(--step-1);
  font-weight: 700;
  color: var(--accent-soft);
  text-align: center;
}

.result__delta {
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.result__delta--plus {
  color: var(--success);
}
.result__delta--minus {
  color: var(--danger);
}

/* ---------------------------------------------------------------- магазин */

.packs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--gap-3);
  /* Ярлык пакета висит над карточкой — оставляем ему место, иначе он
     наезжает на соседний ряд и обрезается */
  padding-top: 10px;
}

.pack {
  position: relative;
  padding: var(--gap-4) var(--gap-3);
  border-radius: var(--radius-md);
  text-align: center;
  background: linear-gradient(170deg, var(--ink-600), var(--ink-800));
  border: 1px solid var(--border);
  transition: border-color var(--dur-fast), transform var(--dur-fast) var(--ease-out);
}

.pack:active {
  transform: scale(0.98);
}

.pack__chips {
  display: block;
  font-family: var(--font-display);
  font-size: var(--step-3);
  font-weight: 700;
  color: var(--brass-400);
  line-height: 1;
}

.pack__unit {
  display: block;
  margin-top: 3px;
  font-size: var(--step--2);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.pack__stars {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: var(--gap-3);
  font-weight: 800;
  color: var(--text);
}

.pack__stars .icon {
  color: var(--brass-400);
}

.pack__badge {
  position: absolute;
  top: -9px;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
}

.goods {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--gap-4);
}

/* Вкладки витрины не прилипают к товарам */
.chips + .goods {
  margin-top: var(--gap-4);
}

.good {
  padding: var(--gap-3);
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--border);
  /* Карточка товара белая — текст на ней тёмный, а не белый, как на фоне */
  color: var(--text);
  text-align: center;
}

.good--owned {
  border-color: var(--border-strong);
}

.good__preview {
  display: grid;
  place-items: center;
  height: 88px;
  margin-bottom: var(--gap-3);
  border-radius: var(--radius-sm);
  background: var(--bg-sunken);
  overflow: hidden;
}

.good__name {
  font-size: var(--step--1);
  font-weight: 700;
  margin-bottom: var(--gap-1);
}

/* Предпросмотр оформления стола и фона */
.swatch {
  width: 78px;
  height: 52px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--table-edge);
  background:
    var(--table-pattern, linear-gradient(transparent, transparent)) 0 0 / var(--table-pattern-size, auto),
    radial-gradient(120% 90% at 50% 30%, var(--table-felt), var(--table-felt-edge));
}

.swatch--bg {
  border-color: transparent;
  background: linear-gradient(160deg, var(--bg-from), var(--bg-to));
}

.swatch--frame {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 3px solid var(--frame-color);
  box-shadow: 0 0 14px var(--frame-glow);
  background: var(--surface-strong);
}

.swatch--title {
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: var(--step-1);
  font-weight: 700;
  color: var(--title-color);
  background: none;
  border: 0;
  width: auto;
  height: auto;
}

/* ---------------------------------------------------------------- профиль */

/* Своя карточка игрока: белая, как карточка за столом, аватар на светлом круге */
.profile-head {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: var(--gap-4) var(--gap-3) var(--gap-3);
  border-radius: var(--radius-lg);
  background: var(--section-bg);
  border: 1.5px solid var(--card-line);
  box-shadow: var(--shadow-ui);
  color: var(--text);
  text-align: center;
}

.profile-head__name {
  font-family: var(--font-display);
  font-size: var(--step-2);
  font-weight: 700;
  line-height: 1.1;
}

/* Рейтинг по режимам: режим, ELO и место в топе одной пилюлей */
.profile-head__ratings {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}

.profile-head__rating {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: var(--pill);
  color: var(--pill-text);
  font-size: var(--step--2);
  font-weight: 600;
}

.profile-head__rating-elo {
  font-family: var(--font-display);
  font-weight: 800;
  color: var(--text);
}

.profile-head__rating-place {
  color: var(--accent);
  font-weight: 800;
}

.profile-head__wallet {
  display: flex;
  gap: var(--gap-2);
  margin-top: 2px;
}

.profile-head__money {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  border: 1.5px solid var(--card-line);
  font-family: var(--font-display);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  font-size: var(--step--1);
}

/* Сетка цифр профиля: те же ячейки, что в карточке игрока, на белой карточке */
.profile-grid {
  margin-top: 0;
  padding: var(--gap-2);
  border-radius: var(--radius-lg);
  background: var(--section-bg);
  border: 1.5px solid var(--card-line);
  box-shadow: var(--shadow-ui);
  color: var(--text);
}

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

.stat {
  padding: var(--gap-3) var(--gap-2);
  border-radius: var(--radius-md);
  background: var(--surface);
  text-align: center;
}

.stat__value {
  font-family: var(--font-display);
  font-size: var(--step-2);
  font-weight: 700;
  color: var(--accent-soft);
  line-height: 1.1;
}

.stat__label {
  font-size: var(--step--2);
  color: var(--text-muted);
}

/* ------------------------------------------------------------- достижения */

.ach-group {
  margin-bottom: var(--gap-5);
}

.ach-group__title {
  margin-bottom: var(--gap-3);
}

.ach {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: var(--gap-3);
  padding: var(--gap-3);
  border-radius: var(--radius-md);
  background: var(--surface);
  /* Карточка белая — текст тёмный, а не белый, как на сукне */
  color: var(--text);
  border: 1px solid transparent;
}

.ach--done {
  border-color: var(--ach-color, var(--border-strong));
}

.ach--secret .ach__name,
.ach--secret .ach__desc {
  filter: blur(0.3px);
  opacity: 0.6;
}

.ach__medal {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--ach-color, var(--brass-400));
  background: color-mix(in srgb, var(--ach-color, var(--brass-500)) 18%, transparent);
  border: 1px solid color-mix(in srgb, var(--ach-color, var(--brass-500)) 50%, transparent);
}

.ach--locked .ach__medal {
  filter: grayscale(1);
  opacity: 0.5;
}

.ach__name {
  font-weight: 800;
  font-size: var(--step--1);
}

.ach__desc {
  font-size: var(--step--2);
  color: var(--text-muted);
  margin-bottom: var(--gap-2);
}

.ach__meter {
  display: flex;
  align-items: center;
  gap: var(--gap-2);
  font-size: var(--step--2);
  color: var(--text-dim);
}

/* -------------------------------------------------------------- лидерборд */

.lb-row {
  display: grid;
  grid-template-columns: 28px auto 1fr auto;
  align-items: center;
  gap: var(--gap-3);
  padding: var(--gap-2) var(--gap-3);
  border-radius: var(--radius-md);
}

.lb-row--you {
  background: var(--surface-strong);
  border: 1px solid var(--border-strong);
}

.lb-row__place {
  font-family: var(--font-display);
  font-size: var(--step-1);
  font-weight: 700;
  text-align: center;
  color: var(--text-muted);
}

.lb-row:nth-child(1) .lb-row__place {
  color: #ffd700;
}
.lb-row:nth-child(2) .lb-row__place {
  color: #c0c0c0;
}
.lb-row:nth-child(3) .lb-row__place {
  color: #cd7f32;
}

/* --------------------------------------------------------------- рефералы */

/* Ссылка-приглашение в шторке. Шторка светлая, поэтому и подложка — лёгкий
   оттенок её текста: тёмная подложка страницы (--bg-sunken) с тёмным текстом
   превращала ссылку в пустую тёмную плашку, похожую на кнопку */
.ref-link {
  display: flex;
  align-items: center;
  gap: var(--gap-2);
  padding: var(--gap-3);
  border-radius: var(--radius-md);
  background: var(--surface-strong);
  color: var(--text);
  border: 1px dashed var(--card-line);
  font-family: var(--font-mono);
  font-size: var(--step--2);
  word-break: break-all;
}

/* Код закрытого стола в шторке приглашения */
.code-value {
  font-family: var(--font-mono);
  font-size: var(--step-1);
  font-weight: 700;
  letter-spacing: 0.28em;
  color: var(--brass-400);
}

/* Блок «откроется за достижение» на карточке товара */
.good__unlock {
  margin-top: var(--gap-3);
  padding-top: var(--gap-3);
  border-top: 1px dashed var(--border);
  text-align: left;
}

.good__unlockTitle {
  font-size: var(--step--2);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.good__unlockName {
  margin: 2px 0 6px;
  font-size: var(--step--1);
  font-weight: 700;
  color: var(--accent-soft);
}

/* Предпросмотр кликабельный: тап примеряет предмет */
.good__preview {
  width: 100%;
  border: 0;
  cursor: pointer;
  transition: transform var(--dur-fast) var(--ease-out);
}

.good__preview:active {
  transform: scale(0.96);
}

/* Пара карт веером в витрине магазина */
/* Карты разведены: лицо и индексы обеих видно, а не одна под другой */
.preview-pair {
  position: relative;
  width: calc(var(--card-w) * 2.05);
  height: var(--card-h);
}

.preview-pair .card {
  position: absolute;
  top: 0;
}

.preview-pair__left {
  left: 0;
  transform: rotate(-9deg);
  transform-origin: bottom center;
}

.preview-pair__right {
  right: 0;
  transform: rotate(9deg);
  transform-origin: bottom center;
}

/* ------------------------------------------------------------ загрузка стола */

/* Силуэты до первого снимка стола: видно, что стол грузится, а не завис */
.skeleton--seat {
  width: 46px;
  height: 46px;
  margin: 0 auto;
  border-radius: 50%;
}

.skeleton--field {
  width: 100%;
  height: calc(var(--card-h) + var(--gap-5));
  border-radius: var(--radius-lg);
  opacity: 0.5;
}

.skeleton--card {
  width: var(--card-w);
  height: var(--card-h);
  margin-left: -10px;
  border-radius: var(--card-radius);
}

.skeleton--card:first-child {
  margin-left: 0;
}

/* ------------------------------------------------------- стол в духе iOS */

/* Банк строго по центру шапки, независимо от ширины кнопок по краям */
.table-top .table-pot {
  position: absolute;
  left: 50%;
  top: calc(var(--safe-top) + var(--gap-2));
  transform: translateX(-50%);
}

/* Место соперника — кнопка: по нажатию открывается его карточка */
.seat {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.seat:active {
  transform: scale(0.96);
}

/* Рука уходит под таб-бар: над ним видно 70 % карты — достоинство и масть
   читаются, а место на экране остаётся полю */
.table-bottom .hand {
  position: relative;
  z-index: 1;
  margin-bottom: calc(var(--card-h) * -0.3);
}

/* Взятая пальцем карта сразу выходит из руки целиком — видно, что её взяли
   и какую карту она побьёт */
.table-bottom .hand .hand__card.card--dragging {
  transform: translate(var(--drag-x, 0), calc(var(--drag-y, 0px) - var(--card-h) * 0.3 - 12px))
    scale(1.06);
  z-index: 3;
}

/* Выбранную карту поднимаем целиком, чтобы её было видно полностью */
.table-bottom .hand .card--selected {
  transform: translateY(calc(var(--card-h) * -0.3 - 8px)) scale(1.04);
}

/* Нижний таб-бар: матовое стекло, как у системных панелей iPhone */
.table-tabbar {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 64px 1fr 64px;
  align-items: center;
  gap: var(--gap-2);
  padding: var(--gap-2) var(--gap-2) calc(var(--safe-bottom) + var(--gap-2));
  background: rgba(8, 16, 12, 0.72);
  -webkit-backdrop-filter: blur(22px) saturate(170%);
  backdrop-filter: blur(22px) saturate(170%);
  border-top: 0.5px solid rgba(255, 255, 255, 0.14);
}

.table-tab {
  display: grid;
  justify-items: center;
  gap: 2px;
  min-height: 48px;
  padding: 4px 0;
  border: 0;
  background: none;
  color: var(--text-dim);
  font: inherit;
  font-size: 10px;
  font-weight: 600;
  -webkit-tap-highlight-color: transparent;
  transition: transform var(--dur-fast) var(--ease-out), color var(--dur-fast);
}

.table-tab:active {
  transform: scale(0.92);
  color: var(--text);
}

/* Действия хода — залитые «капсулы», а не голый текст: их видно сразу */
.table-tabbar .table-actions {
  min-height: 48px;
  padding: 0;
  flex-wrap: nowrap;
  align-items: center;
}

/* Действия хода — плашки с мягкой тенью: сжимаются под пальцем */
.table-tabbar .table-actions .btn {
  min-height: 44px;
  margin-bottom: 0;
  padding: 0 var(--gap-5);
  border-radius: var(--radius-pill);
  font-weight: 700;
  white-space: nowrap;
}

/* ------------------------------------------------------ карточка игрока */

.player-card__head {
  display: grid;
  justify-items: center;
  gap: var(--gap-2);
  text-align: center;
}

.player-card__name {
  margin-top: var(--gap-1);
}

.player-card__place {
  font-size: var(--step--1);
}

.player-card__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gap-2);
  margin-top: var(--gap-5);
}

.player-card__cell,
.player-card__skeleton {
  display: grid;
  justify-items: center;
  gap: 2px;
  min-height: 68px;
  padding: var(--gap-3) var(--gap-2);
  border-radius: var(--radius-md);
  background: var(--section-bg);
}

.player-card__value {
  font-size: var(--step-2);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.player-card__value.is-good {
  color: var(--success);
}

.player-card__value.is-bad {
  color: var(--danger);
}

.player-card__label {
  font-size: var(--step--2);
  color: var(--hint);
  text-align: center;
}

.player-card__error {
  grid-column: 1 / -1;
  text-align: center;
}

/* В ленте рука обрезается по краям: сверху оставляем место, чтобы поднятая
   выбранная карта не срезалась */
.table-bottom .hand--scroll {
  padding-top: calc(var(--card-h) * 0.3 + 14px);
  margin-top: calc(var(--card-h) * -0.3 - 14px);
}

/* --------------------------------------------------- таб-бар приложения */

/* Корневые экраны оставляют снизу место под таб-бар: последняя строка
   списка не должна прятаться под стеклом */
.screen--tabs {
  /* Под плавающим таб-баром: его высота и отступ снизу */
  padding-bottom: calc(var(--safe-bottom) + 100px);
}

/* Таб-бар как в классическом «Дураке» и системный iOS: плоская панель
   снизу, четыре масти с пиктограммой внутри, активная — красная */
/* Таб-бар — бумажная полоса снизу с чёткой кромкой, без стекла */
/* Плавающий таб-бар, как в iOS: капсула над контентом с отступами от краёв,
   полупрозрачный материал с размытием — содержимое видно, как оно уходит под
   панель. Светлая кромка сверху — свет на материале, мягкая тень — глубина */
.app-tabbar {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(var(--safe-bottom) + 10px);
  z-index: var(--z-header);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 6px 4px;
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.82);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.7) inset,
    0 12px 32px -10px rgba(0, 0, 0, 0.45),
    0 2px 6px rgba(0, 0, 0, 0.12);
}

/* Подложка активной вкладки переезжает между вкладками по кривой шторки iOS */
.app-tabbar__pill {
  position: absolute;
  top: 6px;
  bottom: 6px;
  left: 4px;
  width: calc((100% - 8px) / 4);
  border-radius: 24px;
  background: rgba(15, 59, 46, 0.09);
  transform: translateX(calc(100% * var(--tab-index, 0)));
  transition: transform 320ms cubic-bezier(0.32, 0.72, 0, 1);
  pointer-events: none;
}

.app-tab {
  position: relative;
  border-radius: 24px;
}

/* Значок активной вкладки чуть подрастает — отклик на выбор */
.app-tab .suit-tab {
  transition: opacity var(--dur-fast), transform 220ms cubic-bezier(0.23, 1, 0.32, 1);
}

.app-tab.is-active .suit-tab {
  transform: scale(1.08);
}

@media (prefers-reduced-motion: reduce) {
  .app-tabbar__pill,
  .app-tab .suit-tab {
    transition: none;
  }
}

@media (prefers-reduced-transparency: reduce) {
  .app-tabbar {
    background: #ffffff;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}

/* Атрибут hidden слабее собственного display: grid — прячем явно */
.app-tabbar[hidden] {
  display: none;
}

.app-tab {
  display: grid;
  justify-items: center;
  gap: 2px;
  min-height: 46px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--hint);
  font: inherit;
  font-size: 11px;
  font-weight: 500;
  -webkit-tap-highlight-color: transparent;
  transition: color var(--dur-fast), transform var(--dur-fast) var(--ease-out);
}

/* Масти в своих цветах во всех темах: ♣♠ чернильные, ♥♦ тёмно-красные.
   Неактивная вкладка приглушена, активная — в полную силу и с подписью цветом текста */
.app-tab .suit-tab {
  opacity: 0.72;
}

.app-tab .suit-tab--black {
  color: var(--suit-black);
}

.app-tab .suit-tab--red {
  color: var(--suit-red);
}

.app-tab.is-active {
  color: var(--text);
  font-weight: 700;
}

.app-tab.is-active .suit-tab {
  opacity: 1;
}

.app-tab:active {
  transform: scale(0.92);
}

/* ------------------------------------------------------- создание игры */

/* Ставка ползунком по фиксированным значениям, как в классическом «Дураке» */
.bet-slider {
  display: grid;
  gap: var(--gap-1);
  padding: 0 var(--gap-1);
  color: var(--on-bg);
}

.bet-slider__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.bet-slider__title {
  font-size: var(--step-0);
  font-weight: 600;
}

.bet-slider__amount {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-display);
  font-size: var(--step-2);
  font-weight: 800;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  color: var(--on-bg);
}

.bet-slider__range {
  width: 100%;
  /* Зона нажатия 44px при тонкой дорожке */
  height: 44px;
  margin: 0;
  background: none;
  -webkit-appearance: none;
  appearance: none;
}

.bet-slider__range::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.35);
}

.bet-slider__range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 24px;
  height: 24px;
  margin-top: -10px;
  border-radius: 50%;
  background: #ffffff;
  border: 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

.bet-slider__marks {
  position: relative;
  height: 14px;
  font-size: var(--step--2);
  color: var(--on-bg-hint);
  font-variant-numeric: tabular-nums;
}

/* Деления стоят по логарифмической шкале: крайние прижаты к краям */
.bet-slider__marks span {
  position: absolute;
  left: var(--mark);
  transform: translateX(-50%);
  white-space: nowrap;
}

.bet-slider__marks span:first-child {
  transform: none;
}

.bet-slider__marks span:last-child {
  transform: translateX(-100%);
}

.create-field {
  display: grid;
  gap: 6px;
}

.create-field__title {
  font-size: var(--step--1);
  font-weight: 700;
  text-align: center;
}

/* Колода и скорость в одну строку, как на референсе */
.create-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--gap-3);
}

.create-field--speed .seg__item {
  min-width: 52px;
}

.create-field--speed .seg__item .glyph {
  color: inherit;
}

.screen--create {
  gap: var(--gap-3);
}

/* Недопустимое сочетание игроков и колоды: кнопки вздрагивают */
.seg.is-shake {
  animation: seg-shake 320ms var(--ease-out);
}

@keyframes seg-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-5px); }
  40% { transform: translateX(5px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(3px); }
}

/* Сегменты: выбранный — светлее и с галочкой */
.seg {
  display: flex;
  gap: 2px;
  padding: 3px;
  border-radius: var(--radius-pill);
  background: var(--pill);
  color: var(--pill-text);
}

.seg__item {
  display: inline-flex;
  flex: 1 1 0;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: 38px;
  padding: 0 6px;
  border: 0;
  border-radius: var(--radius-pill);
  background: none;
  color: var(--pill-text);
  font: inherit;
  font-size: var(--step-0);
  font-weight: 700;
  transition: background var(--dur-fast), color var(--dur-fast), transform 160ms var(--ease-out);
}

.seg__item:active {
  transform: scale(0.96);
}

.seg__item[aria-pressed="true"] {
  background: #ffffff;
  color: var(--text);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

.seg__item .glyph {
  color: var(--accent);
}

/* Режимы игры плитками: подкидной/переводной и честная/с жульничеством */
.mode-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.mode-tile {
  position: relative;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 4px;
  min-height: 64px;
  padding: 8px 4px;
  border: 0;
  border-radius: var(--radius-md);
  background: var(--pill);
  color: var(--pill-text);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.1;
  text-align: center;
  transition: border-color var(--dur-fast), color var(--dur-fast), transform 160ms var(--ease-out);
}

.mode-tile:active {
  transform: scale(0.97);
}

.mode-tile__icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
}

.mode-tile__check {
  position: absolute;
  top: -6px;
  right: -6px;
  display: none;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  color: #ffffff;
  box-shadow: 0 0 0 3px var(--bg);
}

.mode-tile[aria-pressed="true"] {
  background: #ffffff;
  color: var(--text);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

.mode-tile[aria-pressed="true"] .mode-tile__check {
  display: grid;
}

.create-footer {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: var(--gap-3);
  margin-top: var(--gap-1);
}

.create-private {
  display: flex;
  flex: 1;
  align-items: center;
  gap: var(--gap-2);
  min-width: 0;
  min-height: 46px;
  padding: 0 var(--gap-3);
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--pill);
  color: var(--text);
  font: inherit;
  font-size: var(--step--1);
  font-weight: 600;
  text-align: left;
}

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

.create-go {
  --btn-face: #ffffff;
  --btn-ink: var(--text);
  min-height: 46px;
  margin-bottom: 5px;
  padding: 0 var(--gap-5);
  border-radius: var(--radius-pill);
  font-size: var(--step-0);
  font-weight: 700;
}

/* ------------------------------------------------------- главный экран */

/* Полоса профиля: аватар с именем и рейтингом слева, фишки с «+» справа */
.hub-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gap-2);
  padding: var(--gap-2) var(--gap-3);
  color: var(--text);
  border-radius: var(--radius-lg);
  background: var(--section-bg);
  border: 1.5px solid var(--card-line);
  box-shadow: var(--shadow-ui);
}

.hub-head__me {
  display: flex;
  align-items: center;
  gap: var(--gap-3);
  min-width: 0;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
}

.hub-head__text {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.hub-head__name {
  font-size: var(--step-0);
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hub-head__rating {
  font-size: var(--step--2);
  color: var(--hint);
  white-space: nowrap;
}

.hub-head__wallet {
  display: grid;
  gap: 6px;
  justify-items: end;
  flex: none;
}

.hub-head__row {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Пилюли одной ширины: число выравнивается по правому краю */
.hub-head__row .hub-head__balance {
  min-width: 92px;
  justify-content: flex-end;
}

.hub-head__balance {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 9px;
  font-size: var(--step--1);
  border-radius: var(--radius-pill);
  border: 1.5px solid var(--card-line);
  font-family: var(--font-display);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.hub-head__balance .glyph {
  color: var(--accent);
}

/* «+» к фишкам — круглая кнопка цвета кнопок Telegram */
.hub-head__plus {
  position: relative;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 0;
  background: var(--button);
  color: var(--button-text);
  transition: transform 160ms var(--ease-out);
}

.hub-head__plus:active {
  transform: scale(0.92);
}

/* Быстрая игра — широкая ячейка над сеткой: треугольник и подпись, как в
   классике. Плитки прозрачные, разделены тонкими светлыми линиями */
.hub-quick {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 4px;
  width: 100%;
  padding: var(--gap-3) var(--gap-3) var(--gap-2);
  border: 0;
  border-bottom: 1px solid var(--line-on-bg);
  background: none;
  color: var(--on-bg);
  font: inherit;
  transition: opacity 160ms var(--ease-out);
}

.hub-quick:active {
  opacity: 0.7;
}

.hub-quick__icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  color: var(--on-bg);
}

.hub-quick__icon .glyph {
  width: 30px;
  height: 30px;
  color: var(--hub-icon);
}

/* «Быстрая игра» — залитый треугольник «играть», со скруглёнными углами */
.hub-quick__icon .glyph polygon {
  fill: currentColor;
}

.hub-quick__title {
  font-family: var(--font-display);
  font-size: var(--step-1);
  font-style: italic;
  font-weight: 700;
  line-height: 1.1;
}

.hub-quick__hint {
  font-size: var(--step--2);
  color: var(--on-bg-hint);
}

.hub-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0;
}

.hub-tile {
  position: relative;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 4px;
  min-height: 82px;
  padding: var(--gap-2) var(--gap-3);
  border: 0;
  border-bottom: 1px solid var(--line-on-bg);
  background: none;
  color: var(--on-bg);
  font: inherit;
  transition: background var(--dur-fast);
}

/* Вертикальная линия между двумя плитками ряда */
.hub-tile:nth-child(odd) {
  border-right: 1px solid var(--line-on-bg);
}

.hub-tile:active {
  background: rgba(255, 255, 255, 0.08);
}

/* Нечётная плитка в конце растягивается на весь ряд, чтобы не было дыры */
.hub-tile:last-child:nth-child(odd) {
  grid-column: 1 / -1;
}

/* Иконка белым контуром, без подложки — как в классике */
.hub-tile__icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  /* Линейный значок на стеклянной плашке с золотой кромкой — как фурнитура стола */
  color: var(--hub-icon);
  background: rgba(255, 255, 255, 0.06);
  box-shadow:
    inset 0 0 0 1px rgba(236, 212, 156, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.hub-tile__icon .glyph {
  width: 24px;
  height: 24px;
}

.hub-tile__title {
  font-family: var(--font-display);
  font-size: var(--step--1);
  font-style: italic;
  font-weight: 700;
  letter-spacing: 0;
  text-align: center;
}

/* Счётчик «18 / 60» и значок бонуса в углу плитки */
.hub-tile__count {
  position: absolute;
  top: var(--gap-2);
  right: var(--gap-3);
  font-family: var(--font-display);
  font-size: var(--step--2);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--on-bg-hint);
}

.hub-tile__badge {
  position: absolute;
  top: var(--gap-2);
  right: var(--gap-2);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: var(--accent);
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

/* ------------------------------------------------------ вкладка «Приватные» */

.private-card {
  display: grid;
  justify-items: center;
  gap: var(--gap-2);
  padding: var(--gap-5) var(--gap-4);
  border-radius: var(--radius-lg);
  background: var(--section-bg);
  border: 1.5px solid var(--card-line);
  box-shadow: var(--shadow-ui);
  text-align: center;
}

.private-card__mark {
  display: grid;
  place-items: center;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--tint-orange);
  color: #ffffff;
}

.private-card__title {
  margin-top: var(--gap-1);
}

.private-card .input {
  margin-top: var(--gap-3);
}

.private-card .btn {
  margin-top: var(--gap-2);
}

/* ------------------------------------------------------ открытые игры */

/* Фильтры лежат прямо на фоне, как сегменты в классике */
.lobby-filters {
  display: grid;
  gap: var(--gap-2);
  padding: 0 0 var(--gap-1);
}

.lobby-filters__title {
  font-size: var(--step--1);
  font-weight: 700;
  text-align: center;
  color: var(--hint);
}

/* Строка стола как в классике: имя хозяина сверху, ставка, места, правила */
.table-row {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  grid-template-areas:
    "host host host host"
    "bet seats marks chevron";
  align-items: center;
  gap: 1px var(--gap-3);
  width: 100%;
  padding: var(--gap-2) var(--gap-3);
  border: 0;
  background: none;
  color: var(--text);
  font: inherit;
  text-align: left;
  transition: background var(--dur-fast);
}

.table-row:active {
  background: color-mix(in srgb, var(--text) 6%, transparent);
}

.table-row + .table-row {
  border-top: 1.5px solid var(--separator);
}

.table-row__host {
  grid-area: host;
  font-size: var(--step--1);
  text-align: center;
  color: var(--hint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.table-row__bet {
  grid-area: bet;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-display);
  font-size: var(--step-2);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.table-row__bet .glyph {
  color: var(--accent);
}

.table-row__seats {
  grid-area: seats;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 2px;
  font-size: var(--step-1);
  color: var(--hint);
  font-variant-numeric: tabular-nums;
}

.table-row__marks {
  grid-area: marks;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--hint);
}

.table-row__deck {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 4px;
  border: 1.5px solid currentColor;
  font-size: 11px;
  font-weight: 800;
}

.table-row .row-item__chevron {
  grid-area: chevron;
}

/* --------------------------------------------------- стол как в классике */

/* Шапка: слева назад/флаг, по центру значки правил, справа ставка */
.table-top {
  display: grid;
  /* minmax(0, …): колонка значков может стать уже их содержимого — банк важнее */
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--gap-2);
  padding: calc(var(--safe-top) + var(--gap-3)) var(--gap-3) var(--gap-2);
}

.table-top .table-meta {
  /* safe: если значки не влезают (огромный банк на узком экране), ряд
     прижимается влево и прячет хвост, а не режет значки с обеих сторон */
  justify-content: safe center;
  overflow: hidden;
  /* Значки правил уступают место банку: на узком экране зазоры сжимаются,
     а не выталкивают сумму за край (25.10.2026: «200» обрезалось до «20») */
  min-width: 0;
  gap: clamp(0px, 1vw, var(--gap-2));
}

.table-top .table-meta__mark {
  padding: 4px clamp(1px, 0.6vw, 4px);
  border: 0;
  background: none;
  color: rgba(255, 255, 255, 0.85);
}

.table-top .table-meta__mark--warn {
  color: #ffb3ad;
}

.table-top .table-meta__mark--ok {
  color: #b7f0c8;
}

.table-top .table-pot {
  flex-shrink: 0;
  position: static;
  transform: none;
  flex-direction: row;
  gap: 6px;
  /* Банк без рамки и подложки — только купюра и число, как в классике */
  padding: 4px 0;
  background: none;
  border: 0;
  box-shadow: none;
}

.table-top .table-pot__value {
  font-size: clamp(var(--step-1), 5.5vw, var(--step-2));
  white-space: nowrap;
  color: #ffffff;
  font-family: var(--font-display);
  letter-spacing: -0.02em;
}

.table-top .table-pot__label {
  display: none;
}

.table-leave {
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
}

/* Место соперника: квадратный аватар, число карт в углу, имя под ним и
   веер рубашек, расходящийся из-под аватара */
.seat .avatar,
.seat .avatar img,
.table-me .avatar,
.table-me .avatar img {
  border-radius: 12px;
}

.seat .avatar-wrap[data-frame]::before,
.table-me .avatar-wrap[data-frame]::before {
  border-radius: 14px;
}

.seat__count {
  position: absolute;
  top: -8px;
  right: -8px;
  z-index: 2;
  min-width: 22px;
  padding: 2px 5px;
  border-radius: 8px;
  background: #d4232a;
  color: #ffffff;
  font-size: 12px;
  font-weight: 800;
  text-align: center;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

/* Чей ход — зелёная рамка, как в классике; кольцо таймера у квадрата не нужно */
/* Таймер хода — линия по краю аватара, как в классике: зелёная рамка
   убывает справа налево (по часовой стрелке от верха), к концу краснеет */
.seat .avatar-wrap.is-ticking,
.table-me .avatar-wrap.is-ticking {
  border-radius: 13px;
}

.seat .avatar-wrap.is-ticking::after,
.table-me .avatar-wrap.is-ticking::after {
  content: "";
  display: block;
  position: absolute;
  inset: -5px;
  z-index: 1;
  padding: 3px;
  border-radius: 16px;
  background: conic-gradient(rgba(255, 255, 255, 0.18) calc((100 - var(--turn, 100)) * 1%), #3ddc5f 0);
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask:
    linear-gradient(#000 0 0) content-box exclude,
    linear-gradient(#000 0 0);
  pointer-events: none;
}

.seat .avatar-wrap.is-urgent::after,
.table-me .avatar-wrap.is-urgent::after {
  background: conic-gradient(rgba(255, 255, 255, 0.18) calc((100 - var(--turn, 100)) * 1%), #e5383b 0);
}

.seat__cards {
  position: relative;
  justify-content: center;
  height: 22px;
  width: 64px;
  padding: 0;
}

.seat__back {
  position: absolute;
  bottom: 4px;
  left: calc(50% - 9px);
  margin: 0;
  transform-origin: 50% 160%;
  transform: rotate(calc((var(--index) - (var(--index-count, 1) - 1) / 2) * 10deg)) translateY(2px);
}

.seat__more {
  position: absolute;
  right: -14px;
  bottom: 2px;
}

/* Подсказка про жулика на пустом столе */
.table-hint {
  max-width: 260px;
  margin: 0 auto;
  font-size: var(--step--1);
  text-align: center;
  color: rgba(255, 255, 255, 0.8);
}

/* Нижняя панель: светлая, как в классике. Слева действие или «ваш ход»,
   по центру свой аватар, справа реакции */
.table-tabbar {
  /* Своё место ровно по центру: по бокам одинаковые колонки */
  grid-template-columns: 1fr auto 1fr;
  gap: var(--gap-3);
  padding: var(--gap-2) var(--gap-3) calc(var(--safe-bottom) + var(--gap-2));
  background: #fbf8f1;
  border-top: 0;
  color: #17181c;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.table-tabbar .table-tab {
  color: #6b6f78;
}

/* На сукне кнопки хода всегда чернильные и красные, независимо от схемы */
.table-tabbar .btn-3d {
  --btn-face: #17181c;
  --btn-ink: #fbf8f1;
}

.table-tabbar .btn-3d.btn--danger {
  --btn-face: #d4232a;
  --btn-ink: #ffffff;
}

.table-tabbar .btn-3d.btn--quiet {
  --btn-face: #fbf8f1;
  --btn-ink: #17181c;
  box-shadow: inset 0 0 0 1.5px rgba(23, 24, 28, 0.2);
}

/* Кнопки хода — по центру своей колонки, левее аватара */
.table-tabbar .table-actions {
  justify-content: center;
}

.table-tabbar .table-actions .btn {
  min-height: 54px;
  padding: 0 var(--gap-4);
}

/* Кнопки хода — золотые пилюли; «беру» — красная */
.table-tabbar .btn-3d {
  font-size: var(--step-1);
}

/* «ваш ход» вместо кнопок: золотой текст с отсчётом, без рамок */
.table-tabbar .turn-badge {
  margin: 0;
  padding: 0 var(--gap-2);
  border: 0;
  background: none;
  overflow: visible;
  color: #d4232a;
  font-family: var(--font-display);
  font-size: var(--step-2);
  font-weight: 800;
  letter-spacing: -0.02em;
  animation: none;
}

.table-tabbar .turn-badge::after {
  display: none;
}

.table-tabbar .turn-badge__timer {
  font-size: var(--step-0);
  color: #6b6f78;
}

.table-tabbar .turn-badge--urgent {
  animation: turn-pulse 0.7s var(--ease-out) infinite;
}

.table-me {
  display: grid;
  justify-items: center;
  gap: 2px;
  padding: 0;
  border: 0;
  background: none;
  color: #17181c;
  font: inherit;
  font-size: 11px;
  font-weight: 600;
}

.table-me .avatar-wrap {
  position: relative;
}

.table-me__name {
  max-width: 72px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Рука крупнее, чем карты на столе: её читают и тянут пальцем */
.table-bottom .hand {
  --card-w: 90px;
  --card-h: 128px;
  margin-bottom: calc(var(--card-h) * -0.22);
}

/* Реакции на светлой панели */
.table-tabbar .reactions {
  right: auto;
  left: var(--gap-3);
  width: calc(100% - var(--gap-3) * 2);
}

/* Кнопка «Назад» в шапке вложенного экрана */
.topbar__back {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: none;
  border-radius: 50%;
  border: 1.5px solid var(--card-line);
  background: var(--section-bg);
  color: var(--text);
  transition: transform 160ms var(--ease-out);
}

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

.topbar--nested .topbar__title {
  flex: 1;
}

/* Заголовки экранов — заголовочным шрифтом */
.topbar__title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--on-bg);
}

.create-field__title,
.lobby-filters__title,
.section__title,
.section__footer {
  color: var(--on-bg);
}

.lobby-filters__title,
.section__title,
.section__footer {
  opacity: 0.75;
}

.create-field__title,
.lobby-filters__title,
.private-card__title,
.player-card__name {
  font-family: var(--font-display);
}

.table-tabbar__side {
  display: flex;
  justify-content: flex-end;
}

/* ------------------------------------------------------- комната ожидания */

.table-wait {
  display: grid;
  justify-items: center;
  gap: var(--gap-3);
  padding: 0 var(--gap-4) var(--gap-3);
}

/* Прозрачные кнопки с белой обводкой — как в классическом «Дураке» */
.table-wait__invite,
.table-wait__open {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--gap-2);
  min-height: 46px;
  padding: 0 var(--gap-5);
  border: 2px solid rgba(255, 255, 255, 0.9);
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  font-family: var(--font-display);
  font-size: var(--step-0);
  font-weight: 700;
  transition: transform 160ms var(--ease-out), background var(--dur-fast);
}

.table-wait__invite {
  width: min(100%, 340px);
}

.table-wait__invite:active,
.table-wait__open:active {
  transform: scale(0.97);
  background: rgba(255, 255, 255, 0.18);
}

.table-wait__code {
  display: flex;
  align-items: center;
  gap: var(--gap-3);
  color: #ffffff;
}

.table-wait__label {
  font-size: var(--step--1);
  opacity: 0.8;
}

.table-wait__value {
  font-family: var(--font-mono);
  font-size: var(--step-0);
  font-weight: 700;
  letter-spacing: 0.2em;
}

/* ---------------------------------------------------------- колпак шута */

.jester {
  position: relative;
  width: 200px;
  margin: 0 auto var(--gap-3);
  animation: jester-in 420ms var(--ease-out) both;
}

.jester__hat svg {
  width: 100%;
  height: auto;
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.25));
}

.jester__bell {
  transform-origin: 100px 90px;
  animation: jester-swing 1.6s var(--ease-in-out) infinite alternate;
}

.jester__bell--m {
  animation-delay: 0.2s;
}

.jester__bell--r {
  animation-delay: 0.4s;
}

/* Проигрыш — на простой белой бирке поверх колпака, как в классике */
.jester__tag {
  position: absolute;
  left: 50%;
  bottom: 18%;
  padding: 2px 12px;
  border-radius: 8px;
  border: 1px solid rgba(23, 24, 28, 0.25);
  background: #ffffff;
  color: #17181c;
  font-family: var(--font-display);
  font-size: var(--step-2);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  /* Центр — свойством translate: transform занят анимацией появления */
  translate: -50% 0;
  animation: jester-in 420ms var(--ease-out) 160ms both;
}

@keyframes jester-in {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.92);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes jester-swing {
  from {
    transform: rotate(-3deg);
  }
  to {
    transform: rotate(3deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .jester__bell {
    animation: none;
  }
}

/* --------------------------------------------- тёмный фон, белые карточки */

/* Текст на фоне белый, а всё, что лежит на белом, — тёмный.
   Уведомления сюда не входят: они всегда красные (components.css, .toast) */
.section,
.sheet,
.chips,
.input,
.app-tabbar,
.player-card,
.hub-head__balance {
  color: var(--text);
}

.empty,
.create-field__title,
.create-private__hint {
  color: var(--on-bg);
}

.empty p.dim,
.section__title,
.section__footer {
  color: var(--on-bg-hint);
}

.section .section__title,
.sheet .section__title,
.sheet .section__footer {
  color: var(--hint);
}

.create-private .glyph {
  color: var(--pill-text);
}

/* Чипы фильтров — светлая пилюля на фоне, выбранный чип белый */
.chips {
  background: var(--pill);
  border: 0;
  color: var(--pill-text);
}

.chip {
  color: var(--pill-text);
}

.chip[aria-pressed="true"] {
  background: #ffffff;
  color: var(--text);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

/* ------------------------------------------------------- монеты и бустеры */

.hub-head__balance--coins .glyph {
  color: #f0b429;
}

/* Бустеры в правой части панели стола: круглые кнопки с ценой в монетах */
.table-boosters {
  display: flex;
  gap: 6px;
  align-items: center;
}

.booster {
  position: relative;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: #ffffff;
  /* На столе --text белый (сукно), а кнопка белая — цвет задан явно */
  color: #1c2630;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
  transition: transform 160ms var(--ease-out), opacity var(--dur-fast);
}

.booster:active {
  transform: scale(0.92);
}

.booster[aria-disabled="true"] {
  opacity: 0.35;
}

.booster--poor .booster__price {
  background: var(--destructive);
}

.booster__price {
  position: absolute;
  right: -6px;
  bottom: -4px;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 1px 5px;
  border-radius: var(--radius-pill);
  background: #1c2630;
  color: #ffffff;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.3;
}

/* Шторка «подсмотреть»: имя соперника и его карты веером */
.peek {
  display: grid;
  gap: var(--gap-3);
  margin-top: var(--gap-3);
}

.peek__row {
  display: grid;
  gap: 6px;
}

.peek__name {
  font-size: var(--step--1);
  font-weight: 700;
  color: var(--hint);
}

.peek__cards {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.peek__cards .card {
  --card-w: 40px;
  --card-h: 56px;
}

/* Комната ожидания: руки ещё нет, кнопки прижаты к нижней панели */
.screen.is-waiting .table-bottom .hand {
  display: none;
}

.screen.is-waiting .table-wait {
  padding-bottom: var(--gap-2);
}

/* ----------------------------------------------- карточка профиля (классика) */

.pcard {
  display: grid;
  gap: var(--gap-2);
  color: var(--text);
}

/* Карточка компактнее обычного окна: столбик коротких чисел не тянется на весь экран */
.modal:has(.pcard) {
  width: min(100%, 300px);
  padding: var(--gap-3) var(--gap-3) var(--gap-2);
}

/* Крестик меньше и ближе к углу — над столбиком, не задевает строки */
.modal:has(.pcard) .modal__close {
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
}

.modal:has(.pcard) .modal__close svg {
  width: 14px;
  height: 14px;
}

.pcard__head {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--gap-3);
  align-items: start;
  padding-top: 34px;
}

/* Крупный квадратный аватар с рейтингом в уголке */
.pcard__avatar {
  position: relative;
}

.pcard__avatar .avatar,
.pcard__avatar .avatar img {
  border-radius: var(--radius-md);
}

.pcard__elo {
  position: absolute;
  right: -6px;
  bottom: -6px;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: var(--accent);
  color: #ffffff;
  font-family: var(--font-display);
  font-size: var(--step--2);
  font-weight: 800;
}

.pcard__column {
  display: grid;
  gap: 4px;
}

.pcard__stat {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px 2px 2px;
  border-radius: var(--radius-pill);
  background: var(--pill);
  color: var(--text);
  font-family: var(--font-display);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  font-size: 13px;
}

.pcard__icon {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #ffffff;
  color: var(--pill-text);
}

/* Имя сразу под аватаром, по его ширине: длинное обрезается многоточием */
.pcard__me {
  display: grid;
  gap: 14px;
  width: 72px;
}

.pcard__name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
  font-family: var(--font-display);
  font-size: var(--step-0);
  font-weight: 700;
  line-height: 1.1;
}

.pcard__totals {
  display: grid;
  gap: 2px;
  padding: var(--gap-2) var(--gap-3);
  border-radius: var(--radius-md);
  background: var(--pill);
}

.pcard__totals-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--pill-text);
}

.pcard__total {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
}

.pcard__total-value {
  font-family: var(--font-display);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

/* Строка пакета в магазине: «55 монет за 50 звёзд» */
.pack-row .row-item__text {
  flex: 1;
}

.pack-row__amount {
  font-family: var(--font-display);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.pack-row__for {
  font-size: var(--step--1);
  color: var(--hint);
}

.pack-price {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* Аудит ui-ux-pro-max: зона нажатия не меньше 44px, даже если кнопка меньше */
.hub-head__plus::before {
  content: "";
  position: absolute;
  inset: -8px;
}

.topbar__back {
  min-width: 44px;
  min-height: 44px;
}

/* --------------------------------------------------------- фильтры лобби */

/* Круглая кнопка фильтров в шапке — на месте кошелька, с числом выбранных */
.filters-btn {
  position: relative;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: none;
  border: 0;
  border-radius: 50%;
  background: #ffffff;
  color: var(--text);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
  transition: transform 160ms var(--ease-out);
}

.filters-btn:active {
  transform: scale(0.94);
}

.filters-btn__badge {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--accent);
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
  line-height: 18px;
  text-align: center;
}

.filters-btn__badge[hidden] {
  display: none;
}

.filters {
  display: grid;
  gap: var(--gap-3);
  margin-top: var(--gap-3);
}

.filters__title {
  font-size: var(--step--1);
  font-weight: 700;
  color: var(--hint);
}

/* В шторке подписи сегментов мельче — длинные варианты влезают в строку */
.filters .seg__item {
  font-size: var(--step--1);
  min-height: 40px;
}

.filters__actions {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: var(--gap-2);
  margin-top: var(--gap-4);
}

/* Экран ошибки загрузки: текст на сукне — светлый, кнопка — белая */
.boot-error {
  color: var(--on-bg);
  text-align: center;
}

.boot-error__text {
  color: var(--on-bg-hint);
  padding: 0 var(--gap-4);
}

.boot-error .empty__mark {
  color: var(--text);
}

.boot-error__button {
  background: #ffffff;
  color: var(--text);
}

/* Цена в изумрудах — золотая кнопка: премиум видно с первого взгляда */
.good__buy--coins {
  background: var(--accent);
  color: #ffffff;
}

/* ------------------------------------------------------------ инвентарь */

/* Надетый предмет — золотая рамка карточки и плашка «Надето» вместо кнопки */
.good--equipped {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent);
}

.good__on {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  min-height: 36px;
  margin-top: 10px;
  border: 0;
  border-radius: var(--radius-pill);
  background: rgba(31, 191, 134, 0.14);
  color: #0b6b47;
  font: inherit;
  font-size: var(--step--1);
  font-weight: 700;
}

.good__equip {
  margin-top: 10px;
}

/* Экран достижений на сукне: итог карточкой, кнопка «Все» белая */
.ach-total {
  display: flex;
  align-items: center;
  gap: var(--gap-3);
  margin: 4px 0 var(--gap-4);
  padding: var(--gap-3) var(--gap-4);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.ach-total__medal {
  display: grid;
  flex: none;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: #ffffff;
  color: #c9932b;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.ach-total__body {
  display: grid;
  flex: 1;
  gap: 8px;
  min-width: 0;
}

.ach-total__line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--gap-2);
  color: var(--on-bg);
  font-weight: 700;
}

.ach-total__percent {
  font-family: var(--font-display);
  font-size: var(--step-1);
  font-weight: 800;
  color: #f0c555;
  font-variant-numeric: tabular-nums;
}

.ach-total__track {
  height: 10px;
  overflow: hidden;
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.28);
}

/* Полоса растёт через scaleX: дёшево и плавно */
.ach-total__bar {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #c9932b, #f0c555);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 600ms var(--ease-out);
}

@media (prefers-reduced-motion: reduce) {
  .ach-total__bar {
    transition: none;
  }
}

button.ach-reward {
  border: 0;
  font: inherit;
  font-size: var(--step--2);
  font-weight: 700;
  cursor: pointer;
}

button.ach-reward:active {
  transform: scale(0.96);
}

.ach-group__title {
  color: var(--on-bg);
}

.ach-all {
  margin-top: var(--gap-4);
  background: #ffffff;
  color: var(--text);
}

/* Награды у достижения: фишки и предметы маленькими пилюлями */
.ach__rewards {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.ach-reward {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px 3px 5px;
  border-radius: var(--radius-pill);
  background: var(--pill);
  color: var(--text);
  font-size: var(--step--2);
  font-weight: 700;
}

/* Мини-предпросмотр предмета: та же карта или стол, только крошечные */
.ach-reward__thumb {
  position: relative;
  flex: none;
  width: 30px;
  height: 24px;
  overflow: hidden;
  border-radius: 6px;
}

/* Предпросмотр рисуется в полный размер и ужимается от центра миниатюры */
.ach-reward__thumb > * {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) scale(0.32);
}

/* История и цифры на экране «Статистика» — на сукне */
.screen .section-block > .section__title {
  color: var(--on-bg-hint);
}

.pcard__more {
  min-height: 40px;
  font-size: var(--step--1);
}

/* Отсчёт хода рядом с кнопкой «Беру» или «Бито» — просто цифры, без рамки */
.btn__timer {
  min-width: 2ch;
  margin-left: 6px;
  color: #6b6f78;
  font-family: var(--font-display);
  font-size: var(--step-1);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.btn__timer--urgent {
  color: #d4232a;
}

/* Колпак шута над столом после партии: потом улетает к аватару дурака */
.fool-hat {
  position: fixed;
  left: calc(50% - 85px);
  top: 32%;
  z-index: var(--z-modal);
  width: 170px;
  pointer-events: none;
  will-change: transform, opacity;
}

.fool-hat .jester {
  width: 100%;
  margin: 0;
  animation: none;
}

.fool-hat .jester__tag {
  animation: none;
}

/* Карты на столе крупнее общих: как в классике, масть и достоинство видно
   с вытянутой руки. Колода и бита берут тот же размер */
.screen--table {
  /* Три пары должны помещаться в ряд между колодой и битой: на узком
     экране карты чуть мельче, на широком — до 70 px. Иначе третья карта
     уезжала на новую строку и налезала на соперника */
  --card-w: clamp(44px, calc((100vw - 138px) / 4), 70px);
  --card-h: calc(var(--card-w) * 1.43);
}

.screen--table .table-field {
  column-gap: var(--gap-3);
  max-width: calc((var(--card-w) + 20px) * 3 + var(--gap-3) * 4);
}

/* Наклон брошенной карты — отдельным свойством rotate, чтобы не спорить
   с transform, которым двигают карту полёты */
.table-field__slot .card {
  rotate: var(--tilt, 0deg);
}

/* «Вы берёте» на месте кнопок, пока соперники подкидывают вдогонку */
.table-tabbar .turn-badge--taking {
  color: #6b6f78;
  font-size: var(--step-1);
}

/* Облачко «Бито» — белое, как реплика в классике; «Беру» остаётся красным */
.seat__bubble {
  top: -30px;
  background: #ffffff;
  color: #17181c;
  font-size: 12px;
  z-index: 3;
}

/* Купюра выигрыша над столом — летит к победителю */
.win-cash {
  position: fixed;
  left: calc(50% - 70px);
  top: 30%;
  z-index: var(--z-modal);
  display: grid;
  place-items: center;
  width: 140px;
  pointer-events: none;
  will-change: transform, opacity;
}

.win-cash .glyph {
  width: 140px;
  height: 140px;
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.35));
}

.win-cash__sum {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #ffffff;
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 800;
  text-shadow: 0 2px 0 #1f7a43, 0 0 6px #1f7a43;
}

/* Сияние за колпаком: лучи медленно вращаются и гаснут к краям */
.fool-hat__rays {
  position: absolute;
  inset: -70px;
  z-index: -1;
  background: repeating-conic-gradient(rgba(255, 255, 255, 0.32) 0deg 7deg, transparent 7deg 22deg);
  -webkit-mask: radial-gradient(circle, #000 18%, transparent 62%);
  mask: radial-gradient(circle, #000 18%, transparent 62%);
  animation: rays-spin 9s linear infinite;
}

@keyframes rays-spin {
  to {
    transform: rotate(1turn);
  }
}

/* Знаки итога у аватара до новой раздачи */
.table-me {
  position: relative;
}

.seat__hat {
  position: absolute;
  top: -26px;
  left: 50%;
  z-index: 2;
  width: 64px;
  transform: translateX(-50%);
  pointer-events: none;
}

.seat__hat .jester {
  width: 100%;
  margin: 0;
  animation: none;
}

.seat__hat .jester__tag {
  bottom: 10%;
  padding: 0 5px;
  border-radius: 5px;
  font-size: 11px;
  animation: none;
}

.seat__hat .jester__bell {
  animation: none;
}

.seat__win {
  position: absolute;
  top: -14px;
  left: 50%;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  background: #34b665;
  color: #ffffff;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  transform: translateX(-50%);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

@media (prefers-reduced-motion: reduce) {
  .fool-hat__rays {
    animation: none;
  }
}

/* ------------------------------------------- лобби и фильтры как в классике */

/* Полоса «Настройки фильтров»: значки включённого, справа ставки и игроки */
.fbar {
  display: grid;
  grid-template-columns: 1fr auto auto;
  grid-template-areas:
    "title title title"
    "marks side chevron";
  align-items: center;
  gap: 2px var(--gap-2);
  width: 100%;
  margin-bottom: var(--gap-3);
  padding: 6px var(--gap-3) 8px;
  border: 0;
  border-radius: var(--radius-md);
  background: rgba(0, 0, 0, 0.28);
  color: var(--on-bg);
  font: inherit;
  text-align: left;
}

.fbar:active {
  background: rgba(0, 0, 0, 0.36);
}

.fbar__title {
  grid-area: title;
  font-family: var(--font-display);
  font-size: 12px;
  font-style: italic;
  font-weight: 800;
  text-align: center;
}

.fbar__marks {
  grid-area: marks;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 6px;
}

.fbar__mark,
.fbar__deck {
  display: inline-grid;
  place-items: center;
}

.fbar__deck {
  min-width: 20px;
  height: 18px;
  padding: 0 2px;
  border: 1.5px solid currentColor;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 800;
}

.fbar .is-off {
  opacity: 0.28;
}

.fbar__side {
  grid-area: side;
  display: grid;
  justify-items: end;
  gap: 2px;
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.fbar__players {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: var(--on-bg-hint);
}

.fbar__chevron {
  grid-area: chevron;
  color: var(--on-bg-hint);
}

/* Список столов — тёмные строки прямо на сукне, плотно, как в классике */
.section:has(.table-row) {
  background: rgba(0, 0, 0, 0.22);
  box-shadow: none;
}

.section:has(.table-row) .table-row {
  padding: 4px var(--gap-3) 6px;
  color: var(--on-bg);
}

.section:has(.table-row) .table-row + .table-row {
  border-top: 1px solid var(--line-on-bg);
}

.section:has(.table-row) .table-row__host {
  font-size: 12px;
  color: var(--on-bg-hint);
}

.section:has(.table-row) .table-row__bet {
  font-size: var(--step-1);
}

.section:has(.table-row) .table-row__seats,
.section:has(.table-row) .table-row__marks,
.section:has(.table-row) .row-item__chevron {
  color: var(--on-bg-hint);
}

.section:has(.table-row) .table-row__seats {
  font-size: var(--step-0);
}

.section:has(.table-row) .table-row__marks {
  gap: 4px;
}

.section:has(.table-row) .table-row__deck {
  width: 20px;
  height: 18px;
  font-size: 10px;
}

/* Экран фильтров */
.filters-page {
  display: grid;
  gap: var(--gap-4);
  padding-bottom: calc(var(--gap-5) + 90px);
  color: var(--on-bg);
}

.filters-page__reset {
  justify-self: center;
}

/* Ставки — два бегунка на одной дорожке */
.range2 {
  display: grid;
  gap: var(--gap-2);
}

.range2__head {
  display: flex;
  justify-content: space-between;
  font-weight: 700;
}

.range2__amount {
  font-family: var(--font-display);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.range2__track {
  position: relative;
  height: 32px;
}

.range2__track::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 6px;
  margin-top: -3px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.2);
}

.range2__fill {
  position: absolute;
  top: 50%;
  height: 6px;
  margin-top: -3px;
  border-radius: 3px;
  background: var(--accent);
}

.range2__input {
  position: absolute;
  inset: 0;
  width: 100%;
  margin: 0;
  background: none;
  pointer-events: none;
  -webkit-appearance: none;
  appearance: none;
}

.range2__input::-webkit-slider-runnable-track {
  height: 32px;
  background: none;
}

.range2__input::-webkit-slider-thumb {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35), inset 0 0 0 7px #e9ecef;
  pointer-events: auto;
  -webkit-appearance: none;
  appearance: none;
}

.range2__input::-moz-range-thumb {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  background: #ffffff;
  pointer-events: auto;
}

.range2__marks {
  position: relative;
  height: 16px;
  margin: 0 15px;
  font-size: 11px;
  color: var(--on-bg-hint);
}

.range2__marks span {
  position: absolute;
  transform: translateX(-50%);
}

/* Переключатели игроков, колоды и скорости: включённый — белый */
.fgroup {
  display: grid;
  justify-items: center;
  gap: var(--gap-2);
}

.fgroup__title {
  justify-self: center;
  font-family: var(--font-display);
  font-size: var(--step-1);
  font-style: italic;
  font-weight: 800;
}

.fgroup-row {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: var(--gap-2);
}

.pick-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.pick {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  min-height: 44px;
  padding: 0 12px;
  border: 0;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.14);
  color: var(--on-bg-hint);
  font: inherit;
  font-family: var(--font-display);
  font-size: var(--step-1);
  font-style: italic;
  font-weight: 800;
  transition: transform var(--dur-fast) var(--ease-out), background-color var(--dur-fast);
}

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


.pick[aria-pressed="true"] {
  background: #ffffff;
  color: var(--accent);
}


/* «Нажмите «Готов»» — крупно над столом, как в классике */
.table-wait__ready {
  font-family: var(--font-display);
  font-size: var(--step-1);
  font-weight: 800;
  color: #b8f5c8;
  text-align: center;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  animation: ready-pulse 1.6s var(--ease-in-out) infinite alternate;
}

@keyframes ready-pulse {
  to {
    opacity: 0.6;
  }
}

@media (prefers-reduced-motion: reduce) {
  .table-wait__ready {
    animation: none;
  }
}

/* Реакции — белое окошко сеткой 4×2 над кнопкой, как стикеры в классике */
.table-tabbar .reactions {
  left: auto;
  right: var(--gap-3);
  display: grid;
  grid-template-columns: repeat(4, 56px);
  gap: 6px;
  padding: 10px;
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 12px 32px -8px rgba(0, 0, 0, 0.5);
  transform-origin: bottom right;
  animation: reactions-in 180ms var(--ease-out) both;
}

.table-tabbar .reactions button {
  max-width: none;
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: #f2f4f3;
  font-size: 2rem;
}

@keyframes reactions-in {
  from {
    opacity: 0;
    transform: scale(0.94) translateY(6px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .table-tabbar .reactions {
    animation: none;
  }
}

/* Ряд правил стола плотный и не шире своей колонки: семь значков рядом с
   кнопкой «назад» и банком не должны раздвигать экран вбок */
.table-top .table-meta {
  min-width: 0;
  justify-content: center;
  gap: 2px;
  overflow: hidden;
}

.table-top .table-meta__mark {
  padding: 3px 4px;
}

/* Окно реакций по размеру сетки, а не во всю ширину панели */
.table-tabbar .reactions {
  width: max-content;
  justify-content: start;
}

/* Создание игры в стиле фильтров: выбранное белое с золотом, без галочек */
.screen--create .bet-slider__range::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(
    to right,
    var(--accent) var(--fill, 0%),
    rgba(255, 255, 255, 0.2) var(--fill, 0%)
  );
}

.screen--create .bet-slider__range::-webkit-slider-thumb {
  width: 30px;
  height: 30px;
  margin-top: -12px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35), inset 0 0 0 7px #e9ecef;
}

/* Экран создания — компактно, как в классическом «Дураке» (образец
   владельца 27.10.2026): сегменты сплошной полосой, выбранный — белый с
   красной цифрой и галочкой; режимы — четыре столбика пар, у выбранной
   половины красная галочка в углу */
.screen--create {
  gap: var(--gap-2);
}

:is(.screen--create, .filters-page, .screen--leaders) .seg {
  position: relative;
  gap: 0;
  padding: 3px;
  background: rgba(255, 255, 255, 0.14);
}

/* Белая плашка выбранного сегмента — одна на полосу, едет к выбранному */
.seg__thumb {
  display: none;
}

:is(.screen--create, .screen--leaders) .seg__thumb {
  position: absolute;
  top: 3px;
  bottom: 3px;
  left: 3px;
  display: block;
  width: calc((100% - 6px) / var(--seg-count, 1));
  border-radius: var(--radius-pill);
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
  transform: translateX(calc(var(--seg-index, 0) * 100%));
  transition: transform 260ms var(--ease-out);
}

:is(.screen--create, .filters-page, .screen--leaders) .seg__item {
  position: relative;
  z-index: 1;
  min-height: 34px;
  background: none;
  color: #ffffff;
  font-size: var(--step-0);
  transition: color 200ms var(--ease-out), transform 160ms var(--ease-out);
}

:is(.screen--create, .filters-page, .screen--leaders) .seg__item[aria-pressed="true"] {
  background: none;
  box-shadow: none;
  color: #d4232a;
}

:is(.screen--create, .filters-page) .seg__item .glyph {
  color: currentColor;
}

.seg__tick {
  display: none;
}

:is(.screen--create, .filters-page) .seg__item[aria-pressed="true"] .seg__tick {
  display: inline-grid;
  color: #d4232a;
}

:is(.screen--create, .filters-page) .mode-grid {
  gap: 6px;
}

/* Пара режимов — один столбик: два варианта и белая плашка, которая плавно
   едет вверх или вниз к выбранному (просьба владельца 27.10.2026) */
.mode-pair {
  position: relative;
  display: grid;
  grid-template-rows: 1fr 1fr;
  gap: 2px;
  border-radius: 12px;
}

.mode-pair .mode-tile {
  position: relative;
  z-index: 1;
  min-height: 58px;
  padding: 6px 4px;
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
  font-size: 11px;
  transition: color 200ms var(--ease-out), transform 160ms var(--ease-out);
}

.mode-pair .mode-tile:first-of-type {
  border-radius: 12px 12px 3px 3px;
}

.mode-pair .mode-tile:last-of-type {
  border-radius: 3px 3px 12px 12px;
}

.mode-pair__thumb {
  position: absolute;
  z-index: 1;
  left: 0;
  right: 0;
  top: 0;
  height: calc(50% - 1px);
  border-radius: 12px 12px 3px 3px;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
  transform: translateY(0);
  transition:
    transform 280ms var(--ease-out),
    border-radius 280ms var(--ease-out);
  pointer-events: none;
}

.mode-pair.is-down .mode-pair__thumb {
  border-radius: 3px 3px 12px 12px;
  transform: translateY(calc(100% + 2px));
}

/* Подписи и галочка — над плашкой */
.mode-pair .mode-tile > :not(.mode-tile__check) {
  position: relative;
  z-index: 2;
}

.mode-pair .mode-tile__check {
  z-index: 2;
}

.screen--create .mode-pair .mode-tile[aria-pressed="true"] {
  background: rgba(255, 255, 255, 0.14);
  box-shadow: none;
  color: #d4232a;
}

/* В фильтрах можно включить несколько значений сразу, поэтому общей
   плашки нет: каждое включённое белеет само */
.filters-page {
  gap: var(--gap-2);
}

.filters-page .seg__item[aria-pressed="true"],
.filters-page .mode-pair .mode-tile[aria-pressed="true"] {
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
  color: #d4232a;
}

.filters-page .seg__item,
.filters-page .mode-pair .mode-tile {
  transition:
    background-color 200ms var(--ease-out),
    color 200ms var(--ease-out),
    transform 160ms var(--ease-out);
}

.filters-page .filters-page__reset {
  margin-top: var(--gap-3);
}

@media (prefers-reduced-motion: reduce) {
  .screen--leaders .seg__thumb,
  .screen--create .seg__thumb,
  .mode-pair__thumb {
    transition: none;
  }
}

:is(.screen--create, .filters-page) .mode-tile[aria-pressed="true"] .mode-tile__icon {
  color: #2b3a4a;
}

/* Галочка выбранного режима — красная, в углу плитки, без кружка */
:is(.screen--create, .filters-page) .mode-tile__check {
  top: 3px;
  right: 4px;
  width: auto;
  height: auto;
  background: none;
  color: #d4232a;
  box-shadow: none;
}

.screen--create .create-private {
  gap: var(--gap-3);
  min-height: 44px;
  padding: 0;
  background: none;
  color: #ffffff;
  font-size: var(--step-0);
  font-weight: 700;
}

/* Круглая зелёная галочка, как в iOS (образец владельца 28.10.2026) */
.create-check {
  display: grid;
  flex: none;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 2px solid var(--hint);
  border-radius: 50%;
  color: transparent;
  transition:
    background-color 180ms ease,
    border-color 180ms ease,
    transform 220ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.create-check .glyph {
  width: 15px;
  height: 15px;
}

.create-check:not([aria-checked="true"]) .glyph {
  opacity: 0;
}

.create-check[aria-checked="true"] {
  border-color: #34c759;
  background: #34c759;
  color: #ffffff;
  transform: scale(1.04);
}

.screen--create .create-go {
  min-height: 44px;
  margin-bottom: 0;
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
  box-shadow: none;
}

/* Кнопки хода как в классике: белая плашка, чуть скруглённая, крупный
   красный текст и мягкая тень — без рамки и без «ступеньки» снизу
   (объёмные кнопки владелец попросил убрать 27.10.2026) */
.table-tabbar .table-actions .btn-3d,
.table-tabbar .table-actions .btn-3d.btn--danger,
.table-tabbar .table-actions .btn-3d.btn--primary {
  --btn-face: #ffffff;
  --btn-ink: #d4232a;
  border: 0;
  border-radius: 12px;
  min-width: 128px;
}

.table-tabbar .table-actions .btn-3d.btn--quiet {
  --btn-face: #ffffff;
  --btn-ink: #6b6f78;
  border: 0;
  border-radius: 12px;
}

/* Карточка игрока окошком у его места: компактная, растёт из аватара */
.popover-scrim {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  background: rgba(0, 0, 0, 0.25);
  animation: fade 140ms ease both;
}

.popover-scrim.is-closing {
  opacity: 0;
  transition: opacity 140ms ease;
}

.popover {
  position: fixed;
  padding: var(--gap-3);
  border-radius: 18px;
  background: #ffffff;
  color: var(--text);
  box-shadow: 0 18px 40px -12px rgba(0, 0, 0, 0.55);
  animation: popover-in 180ms cubic-bezier(0.23, 1, 0.32, 1) both;
}

@keyframes popover-in {
  from {
    opacity: 0;
    transform: scale(0.94);
  }
}

.player-card--compact .player-card__head {
  display: flex;
  align-items: center;
  gap: var(--gap-3);
  text-align: left;
  margin-bottom: var(--gap-2);
}

.player-card--compact .player-card__who {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.player-card--compact .player-card__name {
  font-size: var(--step-0);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-card--compact .player-card__place {
  margin: 0;
  font-size: 12px;
}

.player-card--compact .player-card__grid {
  gap: 6px;
}

.player-card--compact .player-card__cell,
.player-card--compact .player-card__skeleton {
  min-height: 0;
  padding: 6px 4px;
  background: #f2f4f3;
}

.player-card--compact .player-card__value {
  font-size: var(--step-1);
}

.player-card--compact .player-card__label {
  font-size: 11px;
}

/* Дружба с соперником прямо из карточки за столом */
.player-card__friend:empty {
  display: none;
}

.player-card__friend {
  margin-top: var(--gap-2);
}

.player-card__friend-add {
  width: 100%;
  min-height: 40px;
  gap: 6px;
}

.player-card__friend-done {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  border-radius: 12px;
  background: #f2f4f3;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 600;
}

@media (prefers-reduced-motion: reduce) {
  .popover {
    animation: none;
  }
}

/* Бустеры в виде карт, как в классике: белая карта с красной рамкой внутри,
   цена изумрудами над правым углом */
.table-tabbar .booster {
  width: 36px;
  height: 50px;
  margin-top: 10px;
  border-radius: 6px;
  border: 1px solid #c9ccd1;
  background: #ffffff;
  color: #d4232a;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.18);
}

.table-tabbar .booster::before {
  content: "";
  position: absolute;
  inset: 3px;
  border: 1.5px solid #d4232a;
  border-radius: 4px;
  opacity: 0.6;
}

.table-tabbar .booster__price {
  top: -14px;
  right: -4px;
  bottom: auto;
  padding: 0 4px;
  background: none;
  color: #17181c;
  font-size: 11px;
}

.table-tabbar .booster--poor .booster__price {
  background: none;
  color: #d4232a;
}

/* Эмоции открываются тапом по себе — окно по центру над своим аватаром */
.table-tabbar .reactions {
  left: 0;
  right: 0;
  margin: 0 auto;
  transform-origin: bottom center;
}

/* ------------------------------------------------------------- друзья */

.friends-search {
  display: flex;
  align-items: center;
  gap: var(--gap-2);
  min-height: 46px;
  margin-bottom: var(--gap-3);
  padding: 0 var(--gap-3);
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.14);
  color: var(--on-bg-hint);
}

.friends-search__input {
  flex: 1;
  min-width: 0;
  height: 44px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--on-bg);
  /* 16px — иначе iOS увеличивает страницу при фокусе */
  font-size: 16px;
}

.friends-search__input::placeholder {
  color: var(--on-bg-hint);
}

.friends-results:not(:empty) {
  margin-bottom: var(--gap-4);
}

.friends-invite {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--gap-2) var(--gap-3);
  margin-bottom: var(--gap-4);
  padding: var(--gap-3);
  border-radius: var(--radius-md);
  background: rgba(0, 0, 0, 0.22);
  color: var(--on-bg);
}

.friends-invite__icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent);
  color: #ffffff;
}

.friends-invite__text {
  align-self: center;
  font-size: var(--step--1);
  color: var(--on-bg-hint);
}

.friends-invite__actions {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap-2);
}

.friends-list__title {
  margin: 0 0 var(--gap-2);
  font-size: var(--step--1);
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--on-bg-hint);
}

.friends-empty {
  padding: var(--gap-3) 0;
  font-size: var(--step--1);
  color: var(--on-bg-hint);
}

.friend-row {
  display: flex;
  align-items: center;
  gap: var(--gap-2);
  padding: 6px 0;
  border-bottom: 1px solid var(--line-on-bg);
}

.friend-row__main {
  display: flex;
  flex: 1;
  align-items: center;
  gap: var(--gap-3);
  min-width: 0;
  min-height: 48px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--on-bg);
  font: inherit;
  text-align: left;
}

.friend-row__text {
  display: grid;
  min-width: 0;
}

.friend-row__name {
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.friend-row__hint {
  font-size: 12px;
  color: var(--on-bg-hint);
}

.friend-row__action {
  display: grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: var(--on-bg);
  transition: transform 160ms var(--ease-out);
}

.friend-row__action:active {
  transform: scale(0.92);
}

.friend-row__action--add {
  background: var(--accent);
  color: #ffffff;
}

.friend-row__action--remove {
  color: #ff8a8a;
}

.friend-row__action--done {
  background: none;
  color: #6fdc8c;
}

/* Аватар в профиле — кнопка смены фото с камерой в углу */
.profile-head__photo {
  position: relative;
  padding: 0;
  border: 0;
  background: none;
  border-radius: 50%;
}

.profile-head__camera {
  position: absolute;
  right: -2px;
  bottom: -2px;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: #ffffff;
  box-shadow: 0 0 0 3px var(--section-bg, #ffffff);
}

/* Переключатель периода статистики: всё время · сезон · неделя */
.period-switch {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  margin-bottom: var(--gap-2);
  padding: 3px;
  border-radius: var(--radius-pill);
  background: var(--pill);
}

.period-switch__item {
  min-height: 36px;
  border: 0;
  border-radius: var(--radius-pill);
  background: none;
  color: var(--pill-text);
  font: inherit;
  font-size: var(--step--1);
  font-weight: 700;
  transition: background-color 160ms ease, color 160ms ease;
}

.period-switch__item[aria-selected="true"] {
  background: #ffffff;
  color: var(--accent);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

/* На тёмном сукне профиля — полупрозрачная подложка, как у фильтров */
.screen .stack > .period-switch {
  background: rgba(255, 255, 255, 0.14);
}

.screen .stack > .period-switch .period-switch__item {
  color: var(--on-bg-hint);
}

.screen .stack > .period-switch .period-switch__item[aria-selected="true"] {
  color: var(--accent);
}

.settings__title {
  padding-right: 40px;
  font-size: var(--step-2);
  color: var(--text);
}

/* Подписи секций в белом окне — серые, а не светлые «на сукно» */
.modal .section__title {
  color: var(--hint);
}

/* Имя в профиле — кнопка с карандашом */
.profile-head__name-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 4px;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
}

.profile-head__pencil {
  display: grid;
  place-items: center;
  color: var(--hint);
}

.name-editor__hint {
  margin: 6px 0 var(--gap-3);
  font-size: var(--step--1);
  color: var(--hint);
}

.name-editor__input {
  width: 100%;
  /* 16px — иначе iOS увеличивает страницу при фокусе */
  font-size: 16px;
}

.name-editor__save {
  margin-top: var(--gap-3);
}



/* ------------------------------------------------------------ как играть */

.rules {
  display: grid;
  gap: var(--gap-2);
  /* Таб-бара на экране правил нет: снизу только обычный отступ */
  padding-bottom: calc(var(--gap-3) + env(safe-area-inset-bottom));
}

.rules__item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--gap-3);
  padding: var(--gap-3);
  border-radius: var(--radius-md);
  background: #ffffff;
  color: var(--text);
}

.rules__number {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--accent);
  color: #ffffff;
  font-family: var(--font-display);
  font-weight: 800;
}

.rules__title {
  font-size: var(--step-0);
  font-weight: 800;
}

.rules__text {
  margin-top: 4px;
  font-size: var(--step--1);
  line-height: 1.45;
  color: var(--hint);
}

/* «Не ваш ход» — красным по центру стола, появляется и плавно гаснет */
.turn-flash {
  position: fixed;
  left: 50%;
  top: 42%;
  z-index: var(--z-modal);
  text-shadow:
    0 1px 2px rgba(0, 0, 0, 0.6),
    0 0 10px rgba(0, 0, 0, 0.35);
  color: #ff4d4f;
  font-family: var(--font-display);
  font-size: var(--step-2);
  font-weight: 800;
  white-space: nowrap;
  pointer-events: none;
  transform: translate(-50%, -50%);
  animation: turn-flash 1.4s var(--ease-out) both;
}

@keyframes turn-flash {
  0% {
    opacity: 0;
    transform: translate(-50%, -40%) scale(0.92);
  }
  15%,
  60% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -56%) scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .turn-flash {
    animation-name: fade-out-slow;
  }
}

@keyframes fade-out-slow {
  0%,
  60% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

/* Свободное место: прозрачный квадрат размером с аватар, пунктир и плюс */
.seat__empty {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 2px dashed rgba(255, 255, 255, 0.45);
  border-radius: 12px;
  color: rgba(255, 255, 255, 0.7);
  transition: transform 160ms var(--ease-out), border-color 160ms ease;
}

.seat--empty {
  padding: 0;
  border: 0;
  background: none;
}

.seat--empty:active .seat__empty {
  transform: scale(0.94);
  border-color: rgba(255, 255, 255, 0.8);
}

/* Правый край панели: бустеры, под ними — изумруды */
.table-tabbar__side {
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.table-coins {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: #17181c;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.table-me__name,
.seat__name {
  max-width: 72px;
  font-size: 11px;
  font-weight: 700;
}

/* Кнопки, которые надо нажать, — с мягкой тенью: видно, что это кнопка,
   но без объёмной «ступеньки» снизу (просьба владельца 27.10.2026) */
.table-tabbar .table-actions .btn-3d,
.btn--primary,
.table-wait__invite,
.table-wait__open {
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12), 0 4px 12px rgba(0, 0, 0, 0.16);
}

.table-tabbar .table-actions .btn-3d:active,
.btn--primary:active {
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12), 0 2px 6px rgba(0, 0, 0, 0.12);
  transform: scale(0.97);
}

/* «!» у достижения, награду за которое ещё не забрали */
.ach__medal {
  position: relative;
}

.ach__alert {
  position: absolute;
  top: -4px;
  right: -4px;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #d4232a;
  color: #ffffff;
  font-size: 12px;
  font-weight: 800;
  box-shadow: 0 0 0 2px #ffffff;
}

.ach__claim {
  margin-top: 8px;
  min-height: 40px;
  padding: 0 var(--gap-4);
}

/* «!» на значке плитки: есть награда, которую надо забрать */
.hub-tile__icon {
  position: relative;
}

.hub-tile__alert {
  position: absolute;
  top: -4px;
  right: -8px;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #d4232a;
  color: #ffffff;
  font-size: 12px;
  font-weight: 800;
  font-style: normal;
  box-shadow: 0 0 0 2px var(--bg);
}

/* Колпак — на правом верхнем углу аватара, чуть набок, как в классике: ник
   над аватаром остаётся открытым. Бирка проигрыша — на самом колпаке */
.avatar-wrap > .seat__hat {
  top: -12px;
  right: -36px;
  left: auto;
  width: 58px;
  transform: rotate(18deg);
}

.avatar-wrap > .seat__hat .jester__tag {
  bottom: 4%;
  padding: 0 4px;
  border-radius: 4px;
  font-size: 10px;
  line-height: 1.35;
  white-space: nowrap;
}

/* Последние 5 секунд хода — линия таймера пульсирует */
.seat .avatar-wrap.is-urgent::after,
.table-me .avatar-wrap.is-urgent::after {
  animation: timer-pulse 0.6s var(--ease-in-out) infinite alternate;
}

@keyframes timer-pulse {
  to {
    opacity: 0.45;
  }
}

@media (prefers-reduced-motion: reduce) {
  .seat .avatar-wrap.is-urgent::after,
  .table-me .avatar-wrap.is-urgent::after {
    animation: none;
  }
}

/* Колода — в своей колонке у левого края, наполовину за ним, по центру
   стола по высоте (сетка .table-mid центрирует её сама); чуть меньше карт
   на столе, чтобы не спорить с ними за внимание */
.table-mid .deck {
  --card-w: 50px;
  --card-h: 72px;
}

/* Своё эмодзи — поверх экрана над своим аватаром */
.seat__reaction--fixed {
  position: fixed;
  z-index: var(--z-modal);
}

/* Выигрыш «+450» — справа от аватара, как и бирка проигрыша: над аватаром
   теперь стоит ник. Ширина — по тексту, число не вылезает за пилюлю */
.seat__win {
  top: 50%;
  left: calc(50% + 28px);
  width: max-content;
  padding: 3px 8px;
  transform: translateY(-50%);
}

/* У соперников «+N» — по центру нижнего края своего аватара, как в
   классическом «Дураке»: справа он наезжал на соседа, когда за столом трое и больше */
.seat .avatar-wrap .seat__win {
  top: auto;
  bottom: -9px;
  left: 50%;
  transform: translateX(-50%);
}

/* Веер соперника — дугой к нему, а не к нам: он держит карты у себя, поэтому
   точка поворота над картами, и они расходятся книзу */
.seat__cards .seat__back {
  transform-origin: 50% -60%;
  transform: rotate(calc((var(--index) - (var(--index-count, 1) - 1) / 2) * -10deg)) translateY(-2px);
}

/* Нижняя панель выше летящих карт: при раздаче карты уходят в руку под
   панель, а не пролетают поверх кнопок */
.table-tabbar {
  z-index: calc(var(--z-flight) + 1);
}

/* Веер соперника — под аватаром, а не на нём: точка поворота над картами
   поднимала их вверх, поэтому опускаем весь веер. Рубашки крупные — по ним
   считают карты соперника */
.seat .seat__cards {
  width: 88px;
  height: 34px;
  margin-top: 22px;
}

.seat .seat__cards .seat__back {
  width: 27px;
  height: 38px;
  left: calc(50% - 13.5px);
}

/* «Сбросить» в фильтрах — белая кнопка с рамкой и тенью: видно, что это кнопка */
.filters-page__reset {
  min-width: 180px;
  min-height: 46px;
  padding: 0 var(--gap-5);
  border: 2px solid rgba(23, 24, 28, 0.12);
  border-radius: var(--radius-pill);
  background: #ffffff;
  color: var(--accent);
  font-weight: 800;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12), 0 4px 12px rgba(0, 0, 0, 0.16);
}

.filters-page__reset:active {
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12), 0 2px 6px rgba(0, 0, 0, 0.12);
}

/* Бонус к первой покупке: плашка над пакетами и «+N бонус» у каждого */
.first-bonus {
  display: flex;
  align-items: center;
  gap: var(--gap-3);
  margin-bottom: var(--gap-3);
  padding: var(--gap-3);
  border-radius: var(--radius-md);
  background: #ffffff;
  color: var(--text);
  font-weight: 700;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1), 0 4px 12px rgba(0, 0, 0, 0.14);
}

.first-bonus__badge {
  flex: none;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: var(--accent);
  color: #ffffff;
  font-family: var(--font-display);
  font-weight: 800;
}

.pack-row__bonus {
  margin-left: 6px;
  font-size: 12px;
  font-weight: 800;
  color: var(--accent);
}

/* ------------------------------------------------ предмет крупным планом */

/* Окно чуть шире подтверждения: картинка здесь главная */
.modal:has(.showcase) {
  width: min(100%, 320px);
  text-align: center;
}

/* Витрина начинается под крестиком, а не под ним: угол не перекрывается */
.modal:has(.showcase) .showcase {
  margin-top: 36px;
}

.showcase {
  display: grid;
  place-items: center;
  min-height: 210px;
  margin: var(--gap-2) 0 var(--gap-3);
  border-radius: var(--radius-md);
  background: var(--bg-sunken);
  overflow: hidden;
}

/* Карты в полный рост: тот же рисунок, только крупнее */
.showcase--card_skin,
.showcase--card_back {
  --card-w: 112px;
  --card-h: 160px;
  display: block;
  padding: var(--gap-2) 0 var(--gap-3);
}

/* Рубашка: переключатель «Рубашка / На столе» и картинка под ним */
.back-showcase {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  width: 100%;
  min-width: 0;
}

.back-showcase__views {
  grid-template-columns: repeat(2, 1fr);
  margin: 0 var(--gap-2) var(--gap-3);
}

.back-showcase__stage {
  display: grid;
  place-items: center;
  grid-template-columns: minmax(0, 1fr);
  min-height: 250px;
}

/* Стол в миниатюре — как в партии. Размеры карт у каждой группы свои */
.showcase--table {
  display: block;
  padding: 0;
}

.scene {
  position: relative;
  width: 100%;
  height: 260px;
  border-radius: var(--radius-md);
  overflow: hidden;
  background:
    var(--table-pattern, linear-gradient(transparent, transparent)) 0 0 / var(--table-pattern-size, auto),
    radial-gradient(120% 70% at 50% 40%, var(--table-felt), var(--table-felt-edge) 78%),
    var(--table-felt-edge);
  box-shadow: inset 0 0 60px rgba(0, 0, 0, 0.4);
}

.back-showcase__stage .scene {
  justify-self: stretch;
  border-radius: 0;
}

.scene .card {
  position: absolute;
  box-shadow: var(--shadow-sm);
}

/* Рука соперника — веером рубашками у верхнего края */
.scene__rival {
  --card-w: 26px;
  --card-h: 37px;
  position: absolute;
  top: 12px;
  left: 50%;
}

.scene__rival-card {
  left: calc(var(--card-w) / -2);
  transform: translateX(calc(var(--scene-i) * 12px)) rotate(calc(var(--scene-i) * 7deg));
  transform-origin: 50% 140%;
}

/* Колода у левого края: козырь поперёк под стопкой */
.scene__deck {
  --card-w: 40px;
  --card-h: 57px;
  position: absolute;
  top: 88px;
  left: 14px;
  width: 70px;
  height: 57px;
}

.scene__trump {
  top: 0;
  left: 20px;
  transform: rotate(90deg);
}

.scene__pile {
  top: 0;
  left: 0;
}

.scene__pile:nth-child(3) {
  transform: translate(1px, -1px);
}

.scene__pile:nth-child(4) {
  transform: translate(2px, -2px);
}

/* Бито у правого края — россыпью */
.scene__discard {
  --card-w: 40px;
  --card-h: 57px;
  position: absolute;
  top: 86px;
  right: 18px;
  width: 40px;
  height: 57px;
}

.scene__discard-card {
  top: 0;
  left: 0;
  transform: translate(calc(var(--scene-i) * 3px), calc(var(--scene-i) * -4px)) rotate(calc(var(--scene-i) * 17deg));
}

/* Пара на поле: атака и отбивающая карта поверх неё */
.scene__field {
  --card-w: 44px;
  --card-h: 63px;
  position: absolute;
  top: 80px;
  left: 50%;
  width: 60px;
  height: 75px;
  margin-left: -30px;
}

.scene__attack {
  top: 0;
  left: 0;
  transform: rotate(-6deg);
}

.scene__defend {
  top: 10px;
  left: 14px;
  transform: rotate(8deg);
}

/* Своя рука — веером снизу */
.scene__hand {
  --card-w: 48px;
  --card-h: 69px;
  position: absolute;
  bottom: 14px;
  left: 50%;
}

.scene__hand-card {
  bottom: 0;
  left: calc(var(--card-w) / -2);
  transform: translateX(calc(var(--scene-i) * 30px)) translateY(calc(var(--scene-i) * var(--scene-i) * 2px))
    rotate(calc(var(--scene-i) * 6deg));
  transform-origin: 50% 120%;
}

/* Вся колода масти лентой: карта по центру, соседние видны по краям */
.showcase--card_skin {
  display: block;
  padding: var(--gap-2) 0 var(--gap-3);
}

/* Лента не должна растягивать окно: ширина — по окну, лишнее листается */
.deck-showcase {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  width: 100%;
  min-width: 0;
}

.deck-showcase__suits {
  grid-template-columns: repeat(4, 1fr);
  margin: 0 var(--gap-2) var(--gap-3);
}

.deck-showcase__suit {
  display: grid;
  place-items: center;
}

.deck-showcase__suit .suit {
  width: 18px;
  height: 18px;
}

.deck-showcase__suit .suit--red {
  color: var(--suit-red);
}

/* Трефы и пики — чёрные, как на картах, и на выбранной пилюле, и без неё */
.deck-showcase__suit .suit--black {
  color: #1b1a18;
}

.deck-showcase__track {
  display: flex;
  gap: 10px;
  /* Лента начинается от левого края окна: туз не уезжает к середине */
  padding: 4px var(--gap-3) 10px;
  scroll-padding-inline: var(--gap-3);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
}

.deck-showcase__track::-webkit-scrollbar {
  display: none;
}

.deck-showcase__stage {
  position: relative;
  min-width: 0;
}

/* Стрелки почти не видны и не мешают смотреть карты, но нажимаются */
.deck-showcase__arrow {
  position: absolute;
  top: 50%;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  margin-top: -21px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(16, 24, 22, 0.42);
  color: #ffffff;
  opacity: 0.6;
  transition:
    opacity 160ms ease,
    transform 160ms var(--ease-out);
}

.deck-showcase__arrow:active {
  opacity: 0.8;
  transform: scale(0.94);
}

.deck-showcase__arrow--prev {
  left: 6px;
}

.deck-showcase__arrow--prev svg {
  transform: scaleX(-1);
}

.deck-showcase__arrow--next {
  right: 6px;
}

.deck-showcase__arrow.is-hidden {
  opacity: 0;
  pointer-events: none;
}

.deck-showcase__slot {
  flex: none;
  scroll-snap-align: start;
}

.deck-showcase__slot .card {
  box-shadow: var(--shadow-md);
}

.showcase--card_back .card {
  box-shadow: var(--shadow-md);
}

/* Фон — с двумя картами сверху */
.showcase--background {
  --card-w: 62px;
  --card-h: 89px;
  background: none;
}

.showcase__felt {
  position: relative;
  width: 100%;
  height: 210px;
  border-radius: var(--radius-md);
}

.showcase__card {
  position: absolute;
  top: 50%;
  left: 50%;
}

.showcase__card--left {
  transform: translate(-82%, -50%) rotate(-8deg);
}

.showcase__card--right {
  transform: translate(-18%, -46%) rotate(7deg);
}

.showcase--frame .swatch--frame,
.showcase--title .swatch--title {
  transform: scale(1.8);
}

.showcase__name {
  font-size: var(--step-1);
  color: var(--text);
  margin-bottom: var(--gap-1);
}

.showcase__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap-2);
  margin-top: var(--gap-4);
}

.showcase__actions .btn {
  min-height: 44px;
  gap: 6px;
}

/* У предмета за достижение купить нечего — «Примерить» во всю ширину */
.showcase__actions .btn:only-child {
  grid-column: 1 / -1;
}

.showcase__rarity {
  font-size: var(--step--1);
  color: var(--hint);
}

/* ------------------------------------------------ анимированные эмодзи */

.anim-emoji {
  display: inline-grid;
  place-items: center;
  line-height: 1;
}

.anim-emoji svg {
  display: block;
}

/* Анимированная реакция над аватаром — без тени-подложки под текст */
.seat__reaction .anim-emoji {
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.45));
}

/* Сетка реакций 4×4 — внутри панели, под вкладками наборов */
.table-tabbar .reactions .reactions__grid {
  display: grid;
  grid-template-columns: repeat(4, 56px);
  gap: 6px;
}

/* Панель без купленных наборов — та же сетка, без вкладок */
.table-tabbar .reactions:not(.reactions--packs) {
  display: block;
}

.table-tabbar .reactions--packs {
  display: grid;
  grid-template-columns: auto;
  gap: 8px;
}

/* Вкладки наборов: по значку набора, скользящая пилюля как везде */
.reactions__tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: #eef1ef;
}

.table-tabbar .reactions .reactions__tabs .chip {
  width: auto;
  height: 34px;
  min-height: 34px;
  border-radius: var(--radius-pill);
  background: none;
  font-size: 1.15rem;
}

/* Эмодзи из купленного набора — с золотой каймой: оно придёт анимированным */
.reactions button.is-premium {
  background: color-mix(in srgb, #ecd49c 35%, var(--surface));
  box-shadow: inset 0 0 0 1.5px #d9b45a;
}

/* Подарок в полёте: поверх стола, от отправителя к получателю */
.gift-fly {
  position: fixed;
  left: 0;
  top: 0;
  z-index: var(--z-toast);
  pointer-events: none;
  will-change: transform;
}

.gift-fly .anim-emoji {
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.5));
}

/* Выбран подарок — соперники мягко пульсируют: тапни, кому подарить */
.is-gift-pick .seat .avatar-wrap {
  animation: gift-target 1.1s ease-in-out infinite;
}

@keyframes gift-target {
  50% {
    transform: scale(1.08);
    filter: drop-shadow(0 0 10px #ecd49c);
  }
}

@media (prefers-reduced-motion: reduce) {
  .is-gift-pick .seat .avatar-wrap {
    animation: none;
    filter: drop-shadow(0 0 8px #ecd49c);
  }
}

/* Набор эмодзи в витрине: четыре символа сеткой 2×2 */
.emoji-preview {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2px 10px;
  font-size: 30px;
  line-height: 1.1;
}

/* Крупный план набора: все эмодзи живыми, сеткой 4×2 */
.emoji-showcase {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  padding: var(--gap-3);
}

/* Вкладкам наборов не нужны подсказка и прыжок, как у самих реакций */
.table-tabbar .reactions .reactions__tabs .chip::before {
  content: none;
}

.table-tabbar .reactions .reactions__tabs .chip:active {
  transform: scale(0.96);
}

/* Ежедневный бонус — первой строкой магазина: белая карточка, как товары,
   зелёная плашка с суммой справа. Бонус забирают только здесь */
.daily-bonus {
  margin-bottom: var(--gap-4);
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--border);
  overflow: hidden;
}

.daily-bonus__row {
  min-height: 60px;
  padding: var(--gap-3);
}

.daily-bonus__title {
  display: block;
  font-weight: 700;
}

.daily-bonus__badge {
  padding: 4px 10px;
  border-radius: 999px;
  background: #1f9d55;
  color: #fff;
  font-size: var(--step--1);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

/* Низкий экран телефона (с шапкой Telegram бывает 600–700 px): соперник,
   его веер и своя панель компактнее — высота уходит картам на столе,
   иначе в две строки они сжимались до 40 px (25.10.2026) */
@media (max-height: 720px) {
  .screen--table .opponents {
    padding-top: var(--gap-2);
  }

  .seat .seat__cards {
    height: 28px;
    margin-top: 12px;
  }

  .seat .seat__cards .seat__back {
    width: 22px;
    height: 31px;
    left: calc(50% - 11px);
  }

  .table-tabbar {
    padding-top: 4px;
  }
}

/* Совсем узкий экран (320 px): колода и скорость прячутся — остальные
   значки правил и банк должны поместиться целиком */
@media (max-width: 340px) {
  .table-top .table-meta__mark:nth-child(n + 5) {
    display: none;
  }
}

/* Сколько карт в колоде — крупно над колодой, в видимой её части (просьба
   владельца 27.10.2026): в углу у козыря цифра терялась */
.table-mid .deck__count {
  top: auto;
  right: 0;
  bottom: calc(100% + 8px);
  min-width: 34px;
  padding: 2px 8px;
  font-size: var(--step-0);
  line-height: 1.2;
}

/* Колода кончилась — масть козыря видна целиком, а не наполовину за краем */
.table-mid .deck__suit {
  margin-left: calc(var(--card-w) / 2 + var(--gap-3));
}

/* Лидеры (27.10.2026): вкладки полосой, строка-подсказка, за что место,
   шапка колонок и крупные победы справа — без режимов и ELO */
.screen--leaders {
  gap: var(--gap-3);
}

.lb-hint {
  margin: 0;
  color: var(--on-bg-hint);
  font-size: var(--step--1);
  text-align: center;
}

.lb-head {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: var(--gap-3);
  padding: 0 var(--gap-3);
  color: var(--on-bg-hint);
  font-size: var(--step--2);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.lb-head span:first-child {
  text-align: center;
}

.screen--leaders .lb-row {
  grid-template-columns: 28px auto 1fr auto;
  background: rgba(255, 255, 255, 0.06);
}

.screen--leaders .lb-row--you {
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.lb-row__who {
  display: grid;
  min-width: 0;
}

.lb-row__name {
  overflow: hidden;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lb-row__games {
  color: var(--on-bg-hint);
  font-size: var(--step--2);
}

.lb-row__won {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-display);
  font-size: var(--step-0);
  font-weight: 800;
}

.lb-row__medal {
  display: grid;
  place-items: center;
}

.lb-row__medal[data-place="1"] {
  color: #ffd24a;
}

.lb-row__medal[data-place="2"] {
  color: #d5dbe1;
}

.lb-row__medal[data-place="3"] {
  color: #e09a5a;
}

.screen--leaders .lb-row__place {
  color: var(--on-bg-hint);
}

/* Фишки и изумруды рядом в правом нижнем углу стола */
.table-wallet {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

/* Выигрыш «+N» — на купюре, как в классике (образец владельца 27.10.2026):
   светло-оливковая бумажка с тёмными цифрами, без значка и зелёной пилюли */
.seat__win {
  padding: 1px 8px;
  border: 1px solid #6d8735;
  border-radius: 4px;
  background: linear-gradient(135deg, #d3e39a 0%, #b4ca74 100%);
  color: #23300f;
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.35), 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* --------------------------------------------------------------- задания */

/* Задания (27.10.2026): карточка задания дня с полосой прогресса и три
   лестницы «победи бота» — плитки ступеней с наградой */
.screen--quests {
  gap: var(--gap-3);
  padding-bottom: calc(var(--gap-5) + 90px);
}

.quest-title {
  margin: var(--gap-2) 0 0;
  color: var(--on-bg);
}

.quest-hint {
  margin: -6px 0 0;
  color: var(--on-bg-hint);
  font-size: var(--step--1);
}

.quest-card {
  display: flex;
  align-items: center;
  gap: var(--gap-3);
  padding: var(--gap-3) var(--gap-4);
  border-radius: var(--radius-md);
  background: #ffffff;
  color: var(--text);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}

.quest-card.is-ready {
  box-shadow: 0 0 0 2px #f0c555, 0 2px 8px rgba(0, 0, 0, 0.18);
}

.quest-card__icon {
  display: grid;
  flex: none;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: #2f9e55;
  color: #ffffff;
}

.quest-card.is-claimed .quest-card__icon {
  background: #8e8e93;
}

.quest-card__body {
  display: grid;
  flex: 1;
  gap: 4px;
  min-width: 0;
}

.quest-card__name {
  font-weight: 800;
}

.quest-card__reward {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-display);
  font-weight: 800;
  color: #2f7d2a;
}

.quest-bar {
  height: 6px;
  overflow: hidden;
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.08);
}

.quest-bar__fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2f9e55, #5cc97f);
  transform-origin: left center;
  transition: transform 500ms var(--ease-out);
}

.quest-count {
  flex: none;
  font-family: var(--font-display);
  font-size: var(--step-1);
  font-weight: 800;
  color: var(--text-dim);
}

.quest-claim {
  flex: none;
  min-height: 40px;
  padding: 0 var(--gap-4);
}

.quest-done {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 4px;
  color: #2f9e55;
  font-weight: 700;
}

.quest-bots {
  display: grid;
  gap: var(--gap-3);
}

.quest-bot {
  display: grid;
  gap: var(--gap-3);
  padding: var(--gap-3);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.quest-bot__head {
  display: flex;
  align-items: center;
  gap: var(--gap-3);
}

.quest-bot__icon {
  display: grid;
  flex: none;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: #ffffff;
  color: #2f9e55;
}

/* Цвет робота — от зелёного у лёгкого к фиолетовому у эксперта */
.quest-bot[data-level="normal"] .quest-bot__icon {
  color: #2b8fc9;
}

.quest-bot[data-level="medium"] .quest-bot__icon {
  color: #c9932b;
}

.quest-bot[data-level="master"] .quest-bot__icon {
  color: #d96a1f;
}

.quest-bot[data-level="hard"] .quest-bot__icon {
  color: #d4232a;
}

.quest-bot[data-level="expert"] .quest-bot__icon {
  color: #7b3fc4;
}

.quest-bot__text {
  display: grid;
  flex: 1;
  min-width: 0;
}

.quest-bot__level {
  color: var(--on-bg);
  font-weight: 800;
}

.quest-bot__wins {
  color: var(--on-bg-hint);
  font-size: var(--step--1);
}

.quest-bot__play {
  flex: none;
  min-height: 40px;
  gap: 6px;
  padding: 0 var(--gap-4);
}

.quest-steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.quest-step {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 8px 4px;
  border: 0;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.22);
  color: var(--on-bg-hint);
  font: inherit;
  font-size: 11px;
  transition: transform 160ms var(--ease-out), background-color 200ms var(--ease-out);
}

.quest-step:active:not([disabled]) {
  transform: scale(0.96);
}

.quest-step.is-ready {
  background: #ffffff;
  color: var(--text);
  box-shadow: 0 0 0 2px #f0c555;
}

.quest-step.is-claimed {
  opacity: 0.55;
}

.quest-step__target {
  font-weight: 800;
}

.quest-step__reward {
  display: grid;
  justify-items: center;
  gap: 2px;
  font-weight: 700;
}

.quest-step__mark {
  color: #2f9e55;
  font-weight: 800;
}

.quest-step.is-ready .quest-step__mark {
  color: #d4232a;
}

@media (prefers-reduced-motion: reduce) {
  .quest-bar__fill {
    transition: none;
  }
}

/* Значок «бот» — маленький робот у ника за столом */
.seat__bot {
  display: inline-grid;
  place-items: center;
  margin-left: 3px;
  color: var(--on-bg-hint);
  opacity: 0.75;
  vertical-align: -1px;
}

/* История игр (27.10.2026): победа — зелёным с кубком, проигрыш — красным
   с колпаком дурака; итог словом, ниже режим и ставка */
.hist-badge {
  display: grid;
  flex: none;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  color: #ffffff;
}

.hist-badge--win {
  background: #2f9e55;
}

.hist-badge--draw {
  background: #8e8e93;
}

.hist-badge--lose {
  padding: 3px;
  background: #fde4e4;
}

.hist-badge--lose svg {
  width: 100%;
  height: auto;
}

.hist-row__result {
  font-weight: 700;
}

.hist-row--win .hist-row__result,
.hist-row--win .hist-row__delta {
  color: #2f9e55;
}

.hist-row--lose .hist-row__result,
.hist-row--lose .hist-row__delta {
  color: #d4232a;
}

.hist-row__delta {
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

/* «Снять» на карточке предмета — настоящая кнопка, а не красный текст
   (просьба владельца 27.10.2026): светло-красная подложка и рамка */
.good .btn--danger {
  border: 1.5px solid rgba(212, 35, 42, 0.35);
  background: #fdecec;
  color: #d4232a;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.good .btn--danger:active {
  background: #f9dada;
}

/* Инвентарь: у надетого — только кнопка «Снять» */
.good__off {
  margin-top: 4px;
}

/* Всё в категории куплено — подсказка и кнопка в инвентарь на всю ширину сетки */
.goods__all-owned {
  display: grid;
  grid-column: 1 / -1;
  justify-items: center;
  gap: var(--gap-2);
  padding: var(--gap-4) 0;
  text-align: center;
}

/* Ник над аватаром: текст обрезается, значок бота рядом не пропадает */
.seat .seat__name {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 96px;
}

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

.quest-step__reward .glyph {
  color: var(--on-bg);
}

.quest-step.is-ready .quest-step__reward .glyph {
  color: var(--text);
}

/* Уровни достижения: «Уровень 2 из 4» и точки — пройденные залиты */
.ach__levels {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 2px 0 4px;
}

.ach__level {
  color: var(--ach-color, #c9932b);
  font-size: var(--step--2);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.ach__dots {
  display: inline-flex;
  gap: 4px;
}

.ach__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.12);
}

.ach__dot.is-done {
  background: var(--ach-color, #c9932b);
}

.ach__dot.is-now:not(.is-done) {
  box-shadow: 0 0 0 1.5px var(--ach-color, #c9932b);
  background: transparent;
}

/* Пакеты валют — каждый отдельной карточкой с зазором */
.pack-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--gap-2);
}

.pack-list > .section__title {
  margin-bottom: 0;
}

/* Друзья: несколько действий в строке и метка «Ждёт ответа» */
.friend-row__actions {
  display: inline-flex;
  gap: 6px;
}

.friend-row__action--decline {
  background: rgba(212, 35, 42, 0.12);
  color: #d4232a;
}

.friend-row__pending {
  flex: none;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: var(--surface-strong);
  color: var(--hint);
  font-size: 12px;
  font-weight: 700;
}

/* Позвать друзей за стол — список в шторке приглашения */
.invite-friends {
  margin-bottom: var(--gap-3);
}

.invite-friends__title {
  margin: 0;
  font-size: var(--step-0);
}

.invite-friends__hint {
  margin: 2px 0 var(--gap-2);
  color: var(--hint);
  font-size: var(--step--1);
}

.invite-friends__list {
  display: grid;
  gap: 8px;
  max-height: 220px;
  overflow-y: auto;
}

.invite-friends__row {
  display: flex;
  align-items: center;
  gap: var(--gap-2);
}

.invite-friends__name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.invite-friends__call {
  flex: none;
  min-width: 96px;
}

/* Цифры статистики не выделяются при тапе */
.player-card__grid {
  -webkit-user-select: none;
  user-select: none;
}

/* Инвентарь: надетое — прозрачная плашка с зелёной галочкой вместо «Снять» */
.good__worn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 38px;
  margin-top: 4px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.12);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  color: var(--text);
  font-size: var(--step--1);
  font-weight: 700;
}

.good__worn-tick {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #34c759;
  color: #ffffff;
}

/* «Беру» у соперника — облачком-сообщением справа от имени, как «Бито»,
   а не красной плашкой над головой (просьба владельца 28.10.2026) */
.seat .seat__says:not(.seat__bubble) {
  top: -4px;
  left: calc(100% - 6px);
  transform: none;
  padding: 3px 10px;
  border-radius: 12px 12px 12px 4px;
  /* «Беру» — красное облачко с белым текстом */
  background: #d4232a;
  color: #ffffff;
  font-size: 12px;
  letter-spacing: 0;
  z-index: 3;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.seat .seat__says:not(.seat__bubble) {
  transform-origin: 0 100%;
  animation: says-side-in 220ms cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes says-side-in {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
}

@media (prefers-reduced-motion: reduce) {
  .seat .seat__says:not(.seat__bubble) {
    animation: none;
  }
}

/* «Готов!» соперника — белое облачко с красным текстом справа от имени */
.seat .seat__bubble--ready {
  top: -4px;
  left: calc(100% - 6px);
  transform: none;
  padding: 3px 10px;
  border-radius: 12px 12px 12px 4px;
  background: #ffffff;
  color: #d4232a;
  font-size: 12px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  transform-origin: 0 100%;
  animation: says-side-in 220ms cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

/* Друзья: блоки «Заявки», «Ждут ответа», «Мои друзья» — с отступом между
   собой, кнопки в строке не прижаты к краю экрана (28.10.2026) */
.friends-list {
  display: grid;
  gap: 4px;
}

.friends-list__title:not(:first-child) {
  margin-top: var(--gap-5);
}

.friend-row {
  padding: 8px 4px 8px 0;
  gap: var(--gap-3);
}

.friend-row__actions {
  gap: 10px;
}

/* Бонус первой покупки — компактной строкой (просьба владельца 28.10.2026) */
.first-bonus {
  gap: var(--gap-2);
  padding: 8px 12px;
  font-size: var(--step--1);
  line-height: 1.3;
}

.first-bonus__badge {
  padding: 2px 8px;
  font-size: 12px;
}

/* «за просмотр» — значок видео на месте цены, как звезда у пакетов */
.daily-bonus__video .glyph {
  color: #d4232a;
}

/* Бонус и реклама — отдельными карточками, как пакеты фишек */
.daily-bonus {
  display: grid;
  gap: var(--gap-2);
  border: 0;
  background: none;
  overflow: visible;
}

.first-bonus-slot:empty {
  display: none;
}

.first-bonus-slot .first-bonus {
  margin-bottom: 0;
}

