/* ==========================================================================
   Game Center — игровой экран: барабаны, символы, панель управления, оверлеи
   ========================================================================== */

.game {
  display: flex;
  flex-direction: column;
  height: 100%;
  --accent: #7c5cff;
  --accent-2: #22d3ee;
  /* Стартовое значение: точный размер ячейки пересчитает layout() в slot.js */
  --cell: 48px;
  --cols: 5;
  --rows: 3;
}

.game__bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0.95;
  transition: opacity 0.5s;
}

.game__stage {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
  min-height: 0;
  padding: 8px 12px 0;
}

/* --------------------------- Инфо-строка -------------------------------- */

.game__info {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
}
.game__info .chip {
  background: rgba(0, 0, 0, 0.35);
}
.game__info .chip--accent {
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 14%, transparent);
}

/* ----------------------------- Автомат ---------------------------------- */

.machine {
  position: relative;
  padding: 10px;
  border-radius: 22px;
  /* Корпус автомата: тёмное стекло + едва уловимая горизонтальная штриховка
     сверху/снизу читается как металлический кожух кабинета (казино-грейд,
     не просто плоская панель), плюс более выраженный внутренний бевел. */
  background: linear-gradient(180deg, rgba(20, 11, 38, 0.92) 0%, rgba(12, 6, 26, 0.88) 14%, rgba(6, 3, 14, 0.92) 86%, rgba(16, 8, 30, 0.9) 100%),
    repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.025) 0px, transparent 1px, transparent 3px);
  border: 1px solid color-mix(in srgb, var(--accent) 34%, var(--stroke));
  box-shadow: 0 0 50px -16px var(--accent), 0 0 90px -40px var(--accent-2),
    inset 0 1px 0 rgba(255, 255, 255, 0.09), inset 0 -12px 26px -18px rgba(0, 0, 0, 0.8),
    0 22px 44px -22px #000;
}

/* Тонкая бегущая рамка вокруг автомата — металлическая окантовка с примесью
   золота поверх акцентных цветов игры, чтобы "казино"-язык (золото/металл)
   читался даже когда --accent/--accent-2 бледные. */
.machine::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 23px;
  padding: 1px;
  background: linear-gradient(
    120deg,
    var(--accent) 0%,
    color-mix(in srgb, var(--gold) 55%, var(--accent)) 18%,
    transparent 32%,
    transparent 68%,
    color-mix(in srgb, var(--gold) 55%, var(--accent-2)) 82%,
    var(--accent-2) 100%
  );
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0.8;
  pointer-events: none;
}

.machine--win {
  animation: machineWin 0.6s var(--ease-out);
}
@keyframes machineWin {
  30% {
    box-shadow: 0 0 70px -10px var(--accent), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  }
}

.reels {
  position: relative;
  display: grid;
  grid-template-columns: repeat(var(--cols), 1fr);
  gap: 6px;
  border-radius: 16px;
  overflow: hidden;
  /* Тёмное "смотровое стекло" барабанов: не плоская заливка, а лёгкий
     радиальный подсвет по центру + внутренний бевел, будто за стеклом
     действительно есть глубина кабинета. */
  background: radial-gradient(ellipse at 50% 40%, rgba(255, 255, 255, 0.045), transparent 65%),
    rgba(0, 0, 0, 0.42);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05), inset 0 2px 10px rgba(0, 0, 0, 0.6);
  padding: 6px;
}

.reel {
  position: relative;
  height: calc(var(--cell) * var(--rows));
  overflow: hidden;
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.015) 40%, rgba(0, 0, 0, 0.08));
  /* Тонкая латунная перегородка между барабанами — светлый блик слева,
     тёмная тень справа, как у соседних стеклянных тубусов одного корпуса. */
  box-shadow: inset 1px 0 0 rgba(255, 255, 255, 0.08), inset -1px 0 0 rgba(0, 0, 0, 0.45);
}

/* Затемнение сверху/снизу — создаёт ощущение глубины барабана, плюс
   диагональный стеклянный блик поверх ленты символов (тот же приём, что
   даёт объём смотровому стеклу настоящего игрового автомата). */
.reel::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
  background: linear-gradient(
      115deg,
      rgba(255, 255, 255, 0.1) 0%,
      transparent 22%,
      transparent 78%,
      rgba(255, 255, 255, 0.04) 100%
    ),
    linear-gradient(
      180deg,
      rgba(0, 0, 0, 0.55) 0%,
      transparent 16%,
      transparent 84%,
      rgba(0, 0, 0, 0.55) 100%
    );
}

.reel__strip {
  display: flex;
  flex-direction: column;
  will-change: transform;
}

/* Раньше тут был filter:blur() на .reel__strip во ВРЕМЯ спина (тот же
   элемент, что одновременно анимируется через transform:translateY на всю
   длительность вращения, ~1.1с/340мс турбо) — убрано 2026-08-14. filter
   на элементе с активной transform-анимацией мешает браузеру положить эту
   анимацию на дешёвый compositor-only путь (нужен на каждый кадр РЕАЛЬНЫЙ
   репейнт через filter-пайплайн, а не просто композитинг слоя) — особенно
   на слабых WebView это роняло кадры настолько, что барабан визуально
   "телепортировался" сразу к результату без видимого вращения (жалоба
   "золото фараона — анимации нет, видна только последняя секунда уже
   готового варианта"). Тот же класс бага, что был у Plinko-призрака
   (filter в @keyframes) — только тут filter статичный, но сама комбинация
   filter+transform на одном элементе уже достаточно проблемна. */

.reel--stop {
  animation: reelStop 0.26s var(--ease-out);
}
@keyframes reelStop {
  0% { transform: translateY(0); }
  45% { transform: translateY(calc(var(--cell) * 0.075)); }
  100% { transform: translateY(0); }
}

/* ------------------------------ Символы --------------------------------- */

.tile {
  position: relative;
  display: grid;
  place-items: center;
  height: var(--cell);
  flex: 0 0 var(--cell);
  border-radius: 9px;
  transition: filter 0.25s, opacity 0.25s, transform 0.25s var(--ease-back);
}

/* Подложка-«жетон»: даёт символу объём (скос, блик, тень отрыва от ленты)
   вместо плоского эмодзи на пустом месте. Один и тот же жетон для всех
   тиров, интенсивность/цвет свечения нарастают через --chip-tint и
   box-shadow в тир-модификаторах ниже. */
.tile::before {
  content: '';
  position: absolute;
  z-index: 0;
  inset: calc(var(--cell) * 0.09);
  border-radius: 50%;
  background: radial-gradient(circle at 30% 24%, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0) 46%),
    linear-gradient(155deg, rgba(255, 255, 255, 0.16) 0%, rgba(255, 255, 255, 0.02) 38%, rgba(0, 0, 0, 0.22) 72%, rgba(0, 0, 0, 0.42) 100%),
    radial-gradient(circle at 50% 55%, var(--chip-tint, rgba(255, 255, 255, 0.05)), transparent 76%);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.4), inset 0 -5px 9px rgba(0, 0, 0, 0.5),
    0 5px 10px -4px rgba(0, 0, 0, 0.65);
  transition: box-shadow 0.25s, filter 0.25s, opacity 0.25s;
}

/* Тонкий обод поверх жетона — держит контур на любом фоне, у wild/scatter
   вместо простого обода бежит цветное кольцо (см. ниже). Двойная inset-тень
   (светлая сверху, тёмная снизу) имитирует гурт настоящей монеты/фишки —
   без неё обод читался как плоская обводка, а не металлический край. */
.tile::after {
  content: '';
  position: absolute;
  z-index: 1;
  inset: calc(var(--cell) * 0.09);
  border-radius: 50%;
  pointer-events: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.32), inset 0 -1px 0 rgba(0, 0, 0, 0.5),
    inset 0 0 0 1px rgba(255, 255, 255, 0.14);
}

.tile__glyph {
  position: relative;
  z-index: 2;
  font-size: calc(var(--cell) * 0.58);
  line-height: 1;
  filter: saturate(1.35) brightness(1.08) drop-shadow(0 3px 4px rgba(0, 0, 0, 0.6))
    drop-shadow(0 1px 0 rgba(255, 255, 255, 0.22));
  transition: transform 0.25s var(--ease-back), filter 0.25s;
  user-select: none;
}

/* Подложка по «редкости» символа — полноценная медальная лестница от
   бронзы (тир 1) до пульсирующего самоцвета (тир 5), как жетоны разного
   номинала в настоящем казино, а не один нейтральный кружок для младших
   символов. */
.tile[data-tier='1']::before {
  --chip-tint: rgba(205, 133, 63, 0.14);
}
.tile[data-tier='1'] .tile__glyph {
  filter: saturate(1.25) brightness(1.05) drop-shadow(0 3px 4px rgba(0, 0, 0, 0.6))
    drop-shadow(0 0 5px rgba(205, 133, 63, 0.28));
}
.tile[data-tier='2']::before {
  --chip-tint: rgba(125, 211, 252, 0.16);
}
.tile[data-tier='2'] .tile__glyph {
  filter: saturate(1.4) brightness(1.1) drop-shadow(0 3px 4px rgba(0, 0, 0, 0.6))
    drop-shadow(0 0 7px rgba(125, 211, 252, 0.35));
}
.tile[data-tier='3']::before {
  --chip-tint: rgba(196, 164, 255, 0.22);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.4), inset 0 -5px 9px rgba(0, 0, 0, 0.5),
    0 5px 10px -4px rgba(0, 0, 0, 0.65), 0 0 13px -4px rgba(196, 164, 255, 0.55);
}
.tile[data-tier='3'] .tile__glyph {
  filter: saturate(1.45) brightness(1.1) drop-shadow(0 3px 5px rgba(0, 0, 0, 0.6))
    drop-shadow(0 0 9px rgba(196, 164, 255, 0.5));
}
.tile[data-tier='4']::before {
  --chip-tint: rgba(255, 209, 102, 0.28);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.45), inset 0 -5px 9px rgba(0, 0, 0, 0.5),
    0 5px 10px -4px rgba(0, 0, 0, 0.65), 0 0 18px -3px rgba(255, 209, 102, 0.65);
}
.tile[data-tier='4'] .tile__glyph {
  filter: saturate(1.5) brightness(1.12) drop-shadow(0 3px 5px rgba(0, 0, 0, 0.55))
    drop-shadow(0 0 11px rgba(255, 209, 102, 0.6));
}
.tile[data-tier='5']::before {
  --chip-tint: color-mix(in srgb, var(--accent) 46%, transparent);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.5), inset 0 -5px 9px rgba(0, 0, 0, 0.5),
    0 5px 10px -4px rgba(0, 0, 0, 0.65), 0 0 22px -2px var(--accent), 0 0 34px -8px var(--accent-2);
  animation: tilePulse 2.2s ease-in-out infinite;
}
.tile[data-tier='5'] .tile__glyph {
  filter: saturate(1.55) brightness(1.15) drop-shadow(0 3px 6px rgba(0, 0, 0, 0.6))
    drop-shadow(0 0 12px var(--accent)) drop-shadow(0 0 22px var(--accent-2));
}
@keyframes tilePulse {
  50% { filter: brightness(1.22) saturate(1.15); }
}

/* Wild — вокруг жетона бежит цветное кольцо поверх обычного обода. */
.tile[data-wild='1']::after {
  background: conic-gradient(from 0deg, var(--accent), var(--accent-2), var(--gold), var(--accent));
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 3px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 3px));
  opacity: 0.85;
  animation: wildSpin 3.4s linear infinite;
}
@keyframes wildSpin {
  to { transform: rotate(1turn); }
}

/* Scatter — тот же тир-5 жетон, но с золотистым оттенком и статичным
   двойным золотым кантом (в отличие от бегущего кольца wild) — читается
   как отдельная золотая монета, а не вариация wild-символа. */
.tile[data-scatter='1']::before {
  --chip-tint: rgba(255, 209, 102, 0.32);
}
.tile[data-scatter='1']::after {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.32), inset 0 -1px 0 rgba(0, 0, 0, 0.5),
    inset 0 0 0 1px var(--gold), inset 0 0 0 3px rgba(0, 0, 0, 0.35);
}

.tile--dim {
  filter: grayscale(0.75) brightness(0.42);
  opacity: 0.55;
}

.tile--win {
  z-index: 2;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 34%, transparent), transparent 72%);
  animation: tileWin 0.72s var(--ease-back) infinite alternate;
}
.tile--win::before {
  animation: tileWinGlow 0.72s var(--ease-back) infinite alternate;
}
/* Пробегающий блик по жетону на выигрышной линии — поверх кольца/жетона,
   но под самим глифом (z-index: 1, как у .tile::after). */
.tile--win::after {
  background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, 0.6) 48%, transparent 66%);
  background-size: 220% 220%;
  mix-blend-mode: overlay;
  animation: chipShine 0.9s ease-in-out infinite;
}
.tile--win .tile__glyph {
  filter: saturate(1.5) drop-shadow(0 0 10px var(--accent)) drop-shadow(0 0 22px var(--accent-2));
}
@keyframes tileWin {
  from { transform: scale(1); }
  to { transform: scale(1.16); }
}
@keyframes tileWinGlow {
  from { filter: brightness(1) saturate(1); }
  to { filter: brightness(1.4) saturate(1.3); }
}
@keyframes chipShine {
  0% { background-position: -60% -60%; }
  100% { background-position: 60% 60%; }
}

.tile--scatter-hit::before {
  animation: tileWinGlow 0.9s var(--ease-back) infinite alternate;
}
.tile--scatter-hit .tile__glyph {
  animation: scatterHit 0.9s var(--ease-back) infinite;
}
@keyframes scatterHit {
  0%, 100% { transform: scale(1) rotate(0); }
  35% { transform: scale(1.25) rotate(-9deg); }
  65% { transform: scale(1.18) rotate(9deg); }
}

/* Бейдж множителя — приподнятая золотая фишка с тёмным кантом (тот же
   мотив, что и rl-chip-badge в рулетке), а не плоская цветная пилюля. */
.tile__mult {
  position: absolute;
  z-index: 3;
  right: -2px;
  bottom: -2px;
  min-width: calc(var(--cell) * 0.34);
  padding: 1px 5px;
  border-radius: 999px;
  font-size: calc(var(--cell) * 0.19);
  font-weight: 900;
  text-align: center;
  background: radial-gradient(circle at 32% 28%, var(--gold-light), var(--gold) 55%, var(--gold-deep) 100%);
  color: #241a05;
  box-shadow: 0 0 0 2px #1a0510, 0 0 0 3px rgba(255, 255, 255, 0.28), 0 3px 8px rgba(0, 0, 0, 0.55);
}

/* ------------------------- Кластерная сетка ------------------------------ */

.cluster-grid {
  display: grid;
  grid-template-columns: repeat(var(--cols), 1fr);
  grid-auto-rows: var(--cell);
  gap: 3px;
  padding: 6px;
  border-radius: 16px;
  /* Игровое поле как инкрустированная доска: радиальный подсвет + едва
     заметная сетка-мозаика вместо плоской чёрной заливки, окантовка в тон
     акцента игры. */
  background: radial-gradient(ellipse at 50% 0%, rgba(255, 255, 255, 0.05), transparent 60%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.015) 0px, transparent 1px, transparent calc(var(--cell) + 3px)),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.015) 0px, transparent 1px, transparent calc(var(--cell) + 3px)),
    rgba(0, 0, 0, 0.42);
  border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04), inset 0 2px 10px rgba(0, 0, 0, 0.6);
}
.cluster-grid .tile {
  flex: none;
}

.tile--drop {
  animation: tileDrop 0.34s var(--ease-out) both;
}
@keyframes tileDrop {
  from {
    transform: translateY(calc(var(--cell) * -2.2));
    opacity: 0;
  }
}

.tile--pop {
  animation: tilePop 0.3s var(--ease-out) forwards;
}
@keyframes tilePop {
  40% {
    transform: scale(1.28);
    filter: brightness(1.9);
  }
  100% {
    transform: scale(0.1) rotate(24deg);
    opacity: 0;
  }
}

.cascade-badge {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  padding: 5px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  color: #fff;
  /* Тонкий золотой кант + двойная тень — читается как настоящая табличка
     каскадного множителя, а не плоская цветная плашка поверх сетки. */
  border: 1px solid color-mix(in srgb, var(--gold) 55%, transparent);
  box-shadow: 0 8px 22px -8px var(--accent), 0 0 0 1px rgba(0, 0, 0, 0.35) inset,
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  z-index: 6;
  animation: badgeIn 0.35s var(--ease-back) both;
}
@keyframes badgeIn {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(-12px) scale(0.8);
  }
}

/* --------------------------- Линии выплат ------------------------------- */

.winlines {
  position: absolute;
  inset: 0;
  /* SVG — заменяемый элемент: без явных размеров он берёт интринсик 300×150,
     поэтому размеры задаём в процентах, а не только через inset. */
  width: 100%;
  height: 100%;
  z-index: 4;
  pointer-events: none;
  overflow: visible;
}
.winlines path {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1200;
  stroke-dashoffset: 1200;
  animation: lineDraw 0.45s var(--ease-out) forwards, linePulse 1.2s ease-in-out 0.45s infinite;
}
/* Пейлайн рисуется двумя наложенными штрихами (см. drawWinLines() в
   slot.js): широкий блюрный "glow" снизу задаёт цвет и свечение, тонкое
   яркое белое "ядро" сверху — саму светящуюся трубку. Раньше линия была
   одним плоским цветным штрихом с drop-shadow — теперь читается как
   настоящий неоновый пейлайн казино-автомата. */
.winlines__glow {
  stroke-width: 7;
  opacity: 0.6;
  filter: drop-shadow(0 0 7px currentColor) drop-shadow(0 0 16px currentColor);
}
.winlines__core {
  stroke: #fff8e0;
  stroke-width: 2.2;
  mix-blend-mode: screen;
  filter: drop-shadow(0 0 5px #fff);
}
@keyframes lineDraw {
  to { stroke-dashoffset: 0; }
}
@keyframes linePulse {
  50% { opacity: 0.4; }
}

/* ---------------------------- Панель игры -------------------------------- */

.game__panel {
  flex: 0 0 auto;
  padding: 10px 12px 4px;
}

.winbar {
  display: flex;
  align-items: center;
  justify-content: center;
  /* Высота зафиксирована (не только min-, но и max-height) и содержимое
     обрезается без переноса — раньше при смене длины текста (ставка,
     множитель, потенциальный выигрыш) блок иногда переносился на 2 строки,
     менял высоту .game__stage и весь экран заметно «дёргался» вбок из-за
     justify-content:center на родителе, пересчитывающего центровку. */
  min-height: 38px;
  max-height: 38px;
  overflow: hidden;
  white-space: nowrap;
  margin-bottom: 8px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  color: var(--muted);
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--stroke-soft);
  transition: color 0.2s, border-color 0.3s, background 0.3s;
}
.winbar--win {
  color: var(--gold);
  border-color: rgba(255, 209, 102, 0.4);
  background: linear-gradient(120deg, rgba(255, 209, 102, 0.16), rgba(255, 61, 129, 0.08));
  text-shadow: 0 0 16px rgba(255, 209, 102, 0.55);
}
.winbar__amount {
  font-variant-numeric: tabular-nums;
  font-size: 19px;
  font-weight: 900;
  margin-left: 6px;
}

.controls {
  display: grid;
  /* minmax(0, 1fr) вместо голого 1fr: колонка всегда делит доступное
     пространство поровну и не может «раздуться» под контент — раньше при
     смене длины текста ставки/счётчика (напр. «100» → «10 000») grid
     пересчитывал ширину 1fr по контенту, и центральная кнопка заметно
     сдвигалась из стороны в сторону. minmax(0,...) убирает эту зависимость
     от контента и не может выйти за экран на узких телефонах (в отличие от
     фиксированных px-колонок).
  */
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.bet {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px;
  border-radius: 999px;
  background: var(--panel);
  border: 1px solid var(--stroke);
}
.bet__btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
  background: rgba(255, 255, 255, 0.08);
  transition: transform 0.15s var(--ease-back), background 0.2s;
}
.bet__btn:active {
  transform: scale(0.86);
  background: rgba(255, 255, 255, 0.16);
}
.bet__btn:disabled {
  opacity: 0.3;
}
.bet__value {
  flex: 1;
  text-align: center;
  min-width: 0;
  overflow: hidden;
}
.bet__value .bet__label,
.bet__value .bet__amount {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.bet__label {
  font-size: 9px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--dim);
  font-weight: 700;
}
.bet__amount {
  font-size: 15px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.spin-btn {
  position: relative;
  width: 88px;
  height: 88px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: #fff;
  background: linear-gradient(145deg, var(--accent), var(--accent-2));
  box-shadow: 0 10px 30px -10px var(--accent), inset 0 2px 0 rgba(255, 255, 255, 0.35),
    inset 0 -3px 8px rgba(0, 0, 0, 0.35);
  transition: transform 0.16s var(--ease-back), filter 0.2s;
}
/* Металлический обод (казино-грейд, 2026-08-14) — тонкое кольцо со
   светлым/тёмным переходом имитирует хромированную/латунную окантовку
   игрового автомата вокруг главной кнопки. Тот же приём exclude-mask-рамки,
   что уже используется у .machine::before (см. выше) — рисуется только
   САМА рамка (центр вырезан маской), поэтому не перекрывает иконку/текст
   кнопки и не требует z-index-трюков. Общий для ВСЕХ игр, т.к. .spin-btn
   не заскоуплен под .game (переиспользуется 1:1, как и .bet/.winbar/.chip). */
.spin-btn::before {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  padding: 3px;
  background: conic-gradient(
    from 200deg,
    #fdfdff 0deg, #86868f 22deg, #232328 50deg, #86868f 78deg,
    #fdfdff 100deg, #86868f 128deg, #232328 160deg, #86868f 210deg,
    #fdfdff 240deg, #86868f 280deg, #232328 320deg, #fdfdff 360deg
  );
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.55);
  pointer-events: none;
}
.spin-btn::after {
  content: '';
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  border: 2px solid color-mix(in srgb, var(--accent) 55%, transparent);
  animation: ringPulse 2.4s ease-out infinite;
}
@keyframes ringPulse {
  0% { transform: scale(0.94); opacity: 0.9; }
  70%, 100% { transform: scale(1.22); opacity: 0; }
}
.spin-btn:active {
  transform: scale(0.92);
}
.spin-btn:disabled {
  filter: grayscale(0.55) brightness(0.7);
}
.spin-btn--busy::after {
  animation: none;
  opacity: 0;
}
.spin-btn__icon {
  display: block;
  font-size: 26px;
  line-height: 1;
}
.spin-btn--busy .spin-btn__icon {
  animation: spinIcon 0.7s linear infinite;
}
@keyframes spinIcon {
  to { transform: rotate(1turn); }
}
.spin-btn__text {
  font-size: 11px;
  margin-top: 2px;
}

/* Была утилита .marquee-frame/--accent (2026-08-14) — бегущая золотая рамка
   через вращающийся exclude-mask-ring, навешана на 10 игр (слоты/карты/
   рулетка/кено/дайс/plinko/крash/chicken/deal). Полностью убрана в тот же
   день: сначала пожаловались, что вращение читается как "спиннер/
   вентилятор", а не бегущие лампы (сделали статичной), затем — что
   постоянная перерисовка exclude-mask+drop-shadow пседвоэлемента поверх
   контейнеров с УЖЕ активной анимацией внутри (барабаны слотов, canvas
   Крash/Plinko, раздача карт, скролл дороги) заметно тормозила именно ЭТИ
   анимации (жалобы "барабаны не крутятся, только последний кадр",
   "Plinko 1 fps"). Решили не чинить дальше, а убрать класс из всех 10 мест
   целиком по прямой просьбе пользователя — decorative ценность не стоила
   cost на слабых устройствах/WebView. Если понадобится похожий приём в
   будущем — НЕ вешать decorative exclude-mask/filter-пседвоэлементы на
   контейнеры, внутри которых уже что-то анимируется, без проверки на
   реальном телефоне через Telegram WebView (не только на десктопе). */

.side-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: stretch;
}
.mini-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 7px 8px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  background: var(--panel);
  border: 1px solid var(--stroke);
  color: var(--muted);
  transition: transform 0.15s var(--ease-back), color 0.2s, border-color 0.2s, background 0.2s;
}
.mini-btn:active {
  transform: scale(0.94);
}
.mini-btn--on {
  color: #fff;
  border-color: color-mix(in srgb, var(--accent) 60%, transparent);
  background: color-mix(in srgb, var(--accent) 26%, transparent);
  box-shadow: 0 0 16px -6px var(--accent);
}

.autoplay-count {
  font-variant-numeric: tabular-nums;
}

/* --------------------------- Фриспин-баннер ------------------------------ */

.freespins {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 8px 14px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 13.5px;
  background: linear-gradient(120deg, rgba(255, 209, 102, 0.22), rgba(255, 61, 129, 0.16));
  border: 1px solid rgba(255, 209, 102, 0.45);
  /* Приподнятая золотая табличка бонуса: внешнее свечение + внутренний
     бевел (светлый верх/тёмный низ), вместо плоской подсвеченной пилюли. */
  box-shadow: 0 0 26px -10px var(--gold), inset 0 1px 0 rgba(255, 255, 255, 0.3),
    inset 0 -2px 5px rgba(0, 0, 0, 0.3);
  animation: fsIn 0.4s var(--ease-back) both;
}
.freespins b {
  font-variant-numeric: tabular-nums;
  color: var(--gold);
}
@keyframes fsIn {
  from {
    opacity: 0;
    transform: translateY(-10px) scale(0.9);
  }
}

/* ------------------------------ Оверлеи ---------------------------------- */

.overlay-root {
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
}

.sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 2, 10, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  pointer-events: auto;
  animation: fadeIn 0.25s var(--ease-out) both;
}
@keyframes fadeIn {
  from { opacity: 0; }
}

.sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: 82vh;
  overflow-y: auto;
  padding: 8px 16px calc(var(--safe-bottom) + 22px);
  border-radius: 24px 24px 0 0;
  background: linear-gradient(180deg, #1a0f2e, #0c0618);
  border-top: 1px solid var(--stroke);
  box-shadow: 0 -22px 50px -20px #000;
  pointer-events: auto;
  animation: sheetIn 0.36s var(--ease-out) both;
}
@keyframes sheetIn {
  from { transform: translateY(100%); }
}
.sheet--out {
  animation: sheetOut 0.28s var(--ease-out) forwards;
}
@keyframes sheetOut {
  to { transform: translateY(100%); }
}
.sheet__grip {
  width: 38px;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
  margin: 4px auto 12px;
}
.sheet__title {
  font-size: 18px;
  font-weight: 800;
  margin-bottom: 4px;
}
.sheet__sub {
  font-size: 12.5px;
  color: var(--muted);
  margin-bottom: 14px;
}

.pay-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 10px;
  border-radius: 12px;
  background: var(--panel);
  border: 1px solid var(--stroke-soft);
  margin-bottom: 6px;
}
.pay-row__glyph {
  font-size: 26px;
  width: 34px;
  text-align: center;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.6));
}
.pay-row__name {
  flex: 1;
  min-width: 0;
  font-size: 13.5px;
  font-weight: 650;
}
.pay-row__note {
  font-size: 11px;
  color: var(--dim);
  font-weight: 500;
}
.pay-row__values {
  text-align: right;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  line-height: 1.5;
}
.pay-row__values b {
  color: var(--gold);
}

/* --------------------------- Большой выигрыш ----------------------------- */

.bigwin {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  pointer-events: auto;
  background: radial-gradient(circle at 50% 45%, rgba(40, 12, 64, 0.9), rgba(4, 2, 10, 0.95));
  animation: fadeIn 0.3s var(--ease-out) both;
}
.bigwin--out {
  animation: fadeOut 0.4s var(--ease-out) forwards;
}
@keyframes fadeOut {
  to { opacity: 0; }
}

.bigwin__rays {
  position: absolute;
  width: 160vmax;
  height: 160vmax;
  background: conic-gradient(
    from 0deg,
    rgba(255, 209, 102, 0.16) 0deg 8deg,
    transparent 8deg 24deg
  );
  animation: spinSlow 14s linear infinite;
  pointer-events: none;
}

.bigwin__label {
  position: relative;
  font-size: clamp(28px, 11vw, 52px);
  font-weight: 900;
  letter-spacing: 2px;
  text-transform: uppercase;
  background: linear-gradient(180deg, #fff8e0, #ffd166 40%, #ff7a3d);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 4px 18px rgba(255, 140, 40, 0.6));
  animation: bigwinPop 0.6s var(--ease-back) both;
}
.bigwin__amount {
  position: relative;
  font-size: clamp(34px, 13vw, 62px);
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  color: #fff;
  text-shadow: 0 0 26px rgba(255, 209, 102, 0.9), 0 0 60px rgba(255, 61, 129, 0.6);
  animation: bigwinPop 0.6s 0.1s var(--ease-back) both;
}
.bigwin__hint {
  position: relative;
  margin-top: 12px;
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.6);
  animation: fadeIn 0.4s 1s var(--ease-out) both;
}
@keyframes bigwinPop {
  from {
    opacity: 0;
    transform: scale(0.5) rotate(-6deg);
  }
}

.fx-canvas {
  position: absolute;
  inset: 0;
  pointer-events: none;
  /* Композитный слой ОТДЕЛЬНО от родителя (2026-08-14, жалобы на жёсткие
     тормоза анимации монет/конфетти — особенно на .cardtable__felt в картах,
     где под fx-canvas лежит тяжёлый многослойный фон стола). Без этой
     подсказки браузер при каждой перерисовке canvas (clearRect+частицы,
     до 60 раз в секунду) может пересчитывать paint для ВСЕГО родителя,
     включая дорогой градиентный фон под canvas — на слабых WebView это и
     даёт наблюдаемые "тормоза". will-change явно выделяет canvas в свой
     слой, родительский фон композитится один раз и переиспользуется. */
  will-change: transform;
  contain: layout paint;
}

/* --------------------------- Итог фриспинов ------------------------------ */

.bonus-summary {
  position: relative;
  padding: 26px 30px;
  border-radius: 24px;
  text-align: center;
  background: linear-gradient(160deg, #2b1750, #150a2b);
  border: 1px solid rgba(255, 209, 102, 0.4);
  box-shadow: 0 0 60px -20px var(--gold);
  animation: bigwinPop 0.5s var(--ease-back) both;
}
.bonus-summary__title {
  font-size: 15px;
  color: var(--muted);
  letter-spacing: 1px;
  text-transform: uppercase;
  font-weight: 700;
}
.bonus-summary__value {
  margin-top: 6px;
  font-size: 40px;
  font-weight: 900;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 26px rgba(255, 209, 102, 0.7);
}

@media (max-height: 680px) {
  .spin-btn {
    width: 76px;
    height: 76px;
  }
  .winbar {
    min-height: 32px;
    margin-bottom: 6px;
  }
}
