/* ============================================================
   SpinTrade — дизайн-система
   Направление: торговый терминал, который играет.
   Деньги и множители — табличные моноширинные цифры, чтобы разряды
   не прыгали, пока число тикает. Зелёный/красный — рыночные, не декоративные.
   ============================================================ */

:root {
  /* Поверхности — глубокий сине-фиолетовый низ казино, а не плоский серый */
  --void: #0a0714;
  --panel: #16112a;
  --panel-2: #1e1838;
  --panel-3: #292048;
  --line: #352a5c;
  --line-soft: #241d40;

  /* Смысловые цвета */
  --mint: #12f2a6;
  --mint-dim: #0bc487;
  --ember: #ff4d6a;
  --gold: #ffcf4d;
  --gold-2: #ffb020;
  --violet: #a882ff;
  --magenta: #ff5cc8;
  --blue: #4a9bff;

  /* Текст */
  --ink: #f3eefe;
  --ink-2: #a99fce;
  --ink-3: #6f6592;

  /* Типографика */
  --sans: ui-sans-serif, "Segoe UI Variable Text", "Segoe UI", Inter, Roboto, system-ui, -apple-system, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "SF Mono", "JetBrains Mono", Consolas, "Liberation Mono", monospace;

  /* Ритм */
  --r-sm: 10px;
  --r: 16px;
  --r-lg: 22px;
  --shell: 1180px;
  --rail: 232px;

  --shadow: 0 22px 60px -20px rgba(0, 0, 0, .9);
  --glow-mint: 0 0 0 1px rgba(18, 242, 166, .3), 0 10px 40px -8px rgba(18, 242, 166, .5);
  --glow-gold: 0 0 0 1px rgba(255, 207, 77, .35), 0 10px 40px -8px rgba(255, 176, 32, .55);
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  /* Глубокий фон казино: цветные пятна света поверх тёмно-фиолетового */
  background:
    radial-gradient(1000px 700px at 12% -8%, rgba(168, 130, 255, .22), transparent 60%),
    radial-gradient(900px 650px at 92% 4%, rgba(18, 242, 166, .16), transparent 58%),
    radial-gradient(1100px 800px at 60% 108%, rgba(255, 92, 200, .16), transparent 60%),
    var(--void);
  background-attachment: fixed;
  color: var(--ink);
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Мягко пульсирующее сияние поверх фона — задаёт «живой» азартный характер */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(600px 600px at 20% 30%, rgba(255, 207, 77, .07), transparent 60%),
    radial-gradient(500px 500px at 80% 70%, rgba(18, 242, 166, .06), transparent 60%);
  pointer-events: none;
  z-index: 0;
  animation: ambientPulse 9s ease-in-out infinite alternate;
}

@keyframes ambientPulse {
  from { opacity: .5; }
  to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  body::before { animation: none; }
}

.hidden { display: none !important; }

/* Все числа — табличные моноширинные */
.num, .balance-value, .stat-value, .mult, .g-mult {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: -.02em;
}

.up { color: var(--mint); }
.down { color: var(--ember); }

/* Подсветка тикающей цены: короткая вспышка в сторону движения */
.tick-up { animation: tickUp .5s ease-out; }
.tick-down { animation: tickDown .5s ease-out; }

@keyframes tickUp {
  0% { color: var(--mint); }
  100% { color: inherit; }
}
@keyframes tickDown {
  0% { color: var(--ember); }
  100% { color: inherit; }
}

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--panel-3); }

:focus-visible {
  outline: 2px solid var(--mint);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ============================================================
   ВХОД
   ============================================================ */

.auth {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px 20px 40px;
  overflow: hidden;
}

/* Плавающие фишки/масти в фоне экрана входа */
.auth::before, .auth::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  filter: blur(2px);
  pointer-events: none;
  z-index: 0;
}
.auth::before {
  width: 260px; height: 260px;
  top: -60px; left: -70px;
  background: radial-gradient(circle at 40% 35%, rgba(255, 207, 77, .28), transparent 62%);
  animation: floatA 11s ease-in-out infinite alternate;
}
.auth::after {
  width: 300px; height: 300px;
  bottom: -90px; right: -80px;
  background: radial-gradient(circle at 40% 35%, rgba(18, 242, 166, .24), transparent 62%);
  animation: floatB 13s ease-in-out infinite alternate;
}

@keyframes floatA { from { transform: translate(0, 0); } to { transform: translate(30px, 40px); } }
@keyframes floatB { from { transform: translate(0, 0); } to { transform: translate(-34px, -30px); } }

.auth-card {
  width: 100%;
  max-width: 420px;
  position: relative;
  z-index: 1;
}

/* Логотип — крупный, с золото-мятным градиентом и живым блеском */
.auth-brand {
  font-family: var(--sans);
  font-size: clamp(46px, 12vw, 62px);
  font-weight: 900;
  letter-spacing: .04em;
  text-align: center;
  background: linear-gradient(100deg, var(--gold) 0%, var(--mint) 45%, var(--violet) 100%);
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 8px;
  filter: drop-shadow(0 4px 26px rgba(18, 242, 166, .35));
  animation: brandShine 6s linear infinite;
}

@keyframes brandShine {
  to { background-position: 220% 0; }
}

.auth-tag {
  text-align: center;
  color: var(--ink-2);
  font-size: 12px;
  font-family: var(--mono);
  letter-spacing: .3em;
  text-transform: uppercase;
  margin-bottom: 28px;
}

/* Карточка форм с неоновым бордюром-градиентом */
.auth-card form,
.auth-card #authFace {
  background: linear-gradient(180deg, rgba(30, 24, 56, .9), rgba(22, 17, 42, .92));
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 22px 20px 24px;
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, .05);
  backdrop-filter: blur(10px);
}

.tabs {
  display: flex;
  gap: 4px;
  background: rgba(14, 10, 28, .6);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 5px;
  margin-bottom: 20px;
}

.tab {
  flex: 1;
  padding: 11px;
  border: 0;
  background: transparent;
  color: var(--ink-2);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  border-radius: 11px;
  cursor: pointer;
  transition: background .2s, color .2s, box-shadow .2s;
}

.tab.active {
  background: linear-gradient(135deg, var(--mint), var(--mint-dim));
  color: #04120c;
  box-shadow: 0 6px 18px -6px rgba(18, 242, 166, .6);
}
.tab:hover:not(.active) { color: var(--ink); }

/* Выбор языка на стартовом экране — флаги */
.auth-langs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 20px;
}
.flag-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 12px;
  background: rgba(14, 10, 28, .55);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  color: var(--ink-2);
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .18s, color .18s, background .18s;
}
.flag-btn .fl { font-size: 20px; line-height: 1; }
.flag-btn:hover { color: var(--ink); border-color: var(--panel-3); }
.flag-btn.on {
  border-color: var(--mint);
  color: var(--ink);
  background: rgba(18, 242, 166, .1);
  box-shadow: 0 0 0 2px rgba(18, 242, 166, .18);
}

.field { margin-bottom: 14px; }

.field label {
  display: block;
  font-size: 11px;
  font-family: var(--mono);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 7px;
}

input, select, textarea {
  width: 100%;
  padding: 14px 15px;
  background: rgba(10, 7, 20, .55);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  color: var(--ink);
  font: inherit;
  font-size: 15px;
  transition: border-color .18s, background .18s, box-shadow .18s;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--mint);
  background: rgba(18, 242, 166, .06);
  box-shadow: 0 0 0 3px rgba(18, 242, 166, .16);
}

input::placeholder { color: var(--ink-3); }
input[type=number] { font-family: var(--mono); font-variant-numeric: tabular-nums; }
select {
  cursor: pointer;
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%), linear-gradient(135deg, var(--ink-3) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}
textarea { resize: vertical; min-height: 90px; font-size: 14px; }

.hint { font-size: 12px; color: var(--ink-3); margin-top: 7px; line-height: 1.45; }

/* ============================================================
   КНОПКИ
   ============================================================ */

.btn {
  width: 100%;
  padding: 15px;
  border: 0;
  border-radius: var(--r-sm);
  font: inherit;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: .01em;
  cursor: pointer;
  transition: transform .12s, filter .18s, box-shadow .2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  position: relative;
  overflow: hidden;
}

/* Пробегающий блик по кнопке — «дорогой» казино-акцент */
.btn::after {
  content: '';
  position: absolute;
  top: 0; left: -60%;
  width: 45%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .38), transparent);
  transform: skewX(-18deg);
  transition: left .5s ease;
}
.btn:hover:not(:disabled)::after { left: 130%; }

.btn:active:not(:disabled) { transform: scale(.98); }
.btn:disabled { opacity: .42; cursor: not-allowed; }

.btn-primary {
  background: linear-gradient(135deg, var(--mint), var(--mint-dim));
  color: #04120c;
  box-shadow: 0 10px 26px -8px rgba(18, 242, 166, .6);
}
.btn-primary:hover:not(:disabled) { filter: brightness(1.06); box-shadow: 0 14px 32px -8px rgba(18, 242, 166, .75); }

.btn-gold {
  background: linear-gradient(135deg, var(--gold), var(--gold-2));
  color: #241500;
  box-shadow: 0 10px 26px -8px rgba(255, 176, 32, .6);
}
.btn-gold:hover:not(:disabled) { filter: brightness(1.06); box-shadow: 0 14px 32px -8px rgba(255, 176, 32, .78); }

.btn-danger { background: var(--ember); color: #fff; }

.btn-ghost { background: var(--panel-2); color: var(--ink); border: 1px solid var(--line); }
.btn-ghost:hover:not(:disabled) { background: var(--panel-3); border-color: var(--panel-3); }

.btn-row { display: flex; gap: 10px; }
.btn-row .btn { flex: 1; }
.btn-sm { padding: 9px 14px; font-size: 13px; width: auto; }
.mt { margin-top: 10px; }

/* ============================================================
   КАРКАС ПРИЛОЖЕНИЯ
   ============================================================ */

.app { position: relative; z-index: 1; }

.shell { max-width: var(--shell); margin: 0 auto; padding: 0 16px 96px; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(7, 11, 18, .82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line-soft);
}

.topbar-inner {
  max-width: var(--shell);
  margin: 0 auto;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.uid-line {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .14em;
  color: var(--ink-3);
  text-transform: uppercase;
}

.balance-label { font-size: 11px; color: var(--ink-3); display: flex; align-items: center; gap: 6px; margin-top: 2px; }

.eye { cursor: pointer; opacity: .6; background: none; border: 0; color: inherit; font-size: 12px; padding: 0; }
.eye:hover { opacity: 1; }

.balance-value { font-size: 26px; font-weight: 700; line-height: 1.15; }
.balance-value small { font-size: 13px; color: var(--ink-3); font-weight: 500; margin-left: 4px; }

.top-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--ink-2);
  font-size: 16px;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background .18s, color .18s, border-color .18s;
}

.icon-btn:hover { background: var(--panel-3); color: var(--ink); border-color: var(--panel-3); }

.deposit-btn {
  padding: 10px 18px;
  border-radius: 11px;
  background: var(--mint);
  color: #04120c;
  border: 0;
  font: inherit;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: filter .18s;
}
.deposit-btn:hover { filter: brightness(1.08); }

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: rgba(16, 22, 32, .96);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}

.nav-item {
  background: none;
  border: 0;
  padding: 11px 4px 13px;
  color: var(--ink-3);
  font: inherit;
  font-size: 10.5px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  position: relative;
  transition: color .18s;
}

.nav-item .ico { font-size: 19px; line-height: 1; filter: grayscale(1) opacity(.55); transition: filter .18s; }
.nav-item.active { color: var(--mint); }
.nav-item.active .ico { filter: none; }
.nav-item.active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 26px;
  height: 2px;
  background: var(--mint);
  border-radius: 0 0 3px 3px;
}

.rail { display: none; }

/* Десктоп: настоящая боковая навигация, а не растянутый телефон */
@media (min-width: 1000px) {
  .shell {
    display: grid;
    grid-template-columns: var(--rail) 1fr;
    gap: 28px;
    padding-bottom: 48px;
    align-items: start;
  }
  .rail { display: block; position: sticky; top: 84px; padding-top: 24px; }
  .rail-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    margin-bottom: 4px;
    background: transparent;
    border: 0;
    border-radius: var(--r-sm);
    color: var(--ink-2);
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
    transition: background .18s, color .18s;
  }
  .rail-item .ico { font-size: 17px; filter: grayscale(1) opacity(.6); }
  .rail-item:hover { background: var(--panel); color: var(--ink); }
  .rail-item.active { background: var(--panel-2); color: var(--mint); }
  .rail-item.active .ico { filter: none; }
  .bottom-nav { display: none; }
  .pages { min-width: 0; padding-top: 24px; }
}

.page { display: none; animation: pageIn .3s ease; }
.page.active { display: block; }

@keyframes pageIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

/* ============================================================
   ОБЩИЕ БЛОКИ
   ============================================================ */

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 26px 0 12px;
}

.section-title { font-size: 17px; font-weight: 700; letter-spacing: -.01em; }

.eyebrow {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 16px;
  margin-bottom: 12px;
}

.card.flush { padding: 0; overflow: hidden; }

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
  font-weight: 700;
  font-size: 15px;
}

.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: 14px;
}
.row:last-child { border-bottom: 0; }
.row .label { color: var(--ink-3); font-size: 13px; }
.row .value { font-weight: 600; text-align: right; word-break: break-word; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 700;
  font-family: var(--mono);
  letter-spacing: .04em;
}
.badge.green { background: rgba(0, 229, 160, .14); color: var(--mint); }
.badge.red { background: rgba(255, 77, 94, .14); color: var(--ember); }
.badge.gold { background: rgba(255, 194, 75, .14); color: var(--gold); }
.badge.grey { background: var(--panel-3); color: var(--ink-2); }

.note {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-left: 2px solid var(--mint-dim);
  border-radius: var(--r-sm);
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink-2);
  margin: 12px 0;
}
.note strong { color: var(--ink); }
.note.warn { border-left-color: var(--gold); }
.note.bad { border-left-color: var(--ember); }

.empty { text-align: center; padding: 36px 20px; color: var(--ink-3); font-size: 14px; }
.empty .big { font-size: 32px; display: block; margin-bottom: 10px; opacity: .5; }

.quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 16px; }

.quick-item {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 14px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-2);
  transition: background .18s, transform .12s, border-color .18s;
}
.quick-item:hover { background: var(--panel-2); border-color: var(--panel-3); color: var(--ink); }
.quick-item:active { transform: scale(.97); }
.quick-ico { font-size: 19px; }

.promo {
  margin-top: 16px;
  border-radius: var(--r-lg);
  padding: 22px;
  background:
    radial-gradient(120% 140% at 92% 8%, rgba(0, 229, 160, .18), transparent 55%),
    linear-gradient(120deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 16px;
  overflow: hidden;
}
.promo h3 { font-size: 19px; font-weight: 700; letter-spacing: -.01em; margin-bottom: 8px; }
.promo p { font-size: 13px; color: var(--ink-2); line-height: 1.5; }
.promo-marks { display: flex; gap: 6px; margin-top: 12px; flex-wrap: wrap; }
.promo-marks span {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: .14em;
  padding: 4px 8px;
  border-radius: 5px;
  background: rgba(255, 255, 255, .05);
  color: var(--ink-2);
}
.promo-art { font-size: 54px; line-height: 1; opacity: .9; }

.market-tabs, .sub-tabs { display: flex; gap: 6px; margin: 16px 0 10px; overflow-x: auto; scrollbar-width: none; }
.market-tabs::-webkit-scrollbar, .sub-tabs::-webkit-scrollbar { display: none; }

.chip {
  padding: 8px 15px;
  border-radius: 99px;
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--ink-2);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background .18s, color .18s, border-color .18s;
}
.chip:hover { color: var(--ink); }
.chip.active { background: var(--mint); color: #04120c; border-color: var(--mint); }

.mkt-head, .mkt-row {
  display: grid;
  grid-template-columns: 1.6fr 1fr .8fr;
  gap: 10px;
  align-items: center;
  padding: 11px 12px;
}
.mkt-head {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-3);
  border-bottom: 1px solid var(--line);
}
.mkt-row {
  border-bottom: 1px solid var(--line-soft);
  font-size: 14px;
  width: 100%;
  background: none;
  border-left: 0; border-right: 0; border-top: 0;
  color: inherit;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
  transition: background .16s;
}
.mkt-row:hover { background: var(--panel-2); }
.mkt-row:last-child { border-bottom: 0; }
.coin { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.coin-ico {
  width: 30px; height: 30px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--panel-3);
  font-size: 12px; font-weight: 700;
  font-family: var(--mono);
  color: var(--ink-2);
  flex-shrink: 0;
}
.mkt-row .price, .mkt-row .chg { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; }
.mkt-row .chg { font-size: 13px; }

.leader { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-bottom: 1px solid var(--line-soft); }
.leader:last-child { border-bottom: 0; }
.rank {
  width: 25px; height: 25px;
  border-radius: 7px;
  display: grid; place-items: center;
  background: var(--panel-3);
  font-family: var(--mono);
  font-size: 11px; font-weight: 700;
  color: var(--ink-2);
  flex-shrink: 0;
}
.rank.t1 { background: rgba(255, 194, 75, .18); color: var(--gold); }
.rank.t2 { background: rgba(190, 200, 215, .16); color: #c3ccdb; }
.rank.t3 { background: rgba(205, 127, 50, .18); color: #d08b4a; }
.leader-name { font-weight: 600; font-size: 14px; }
.leader-sub { font-size: 11.5px; color: var(--ink-3); margin-top: 2px; font-family: var(--mono); }
.leader-pct { margin-left: auto; font-family: var(--mono); font-size: 13.5px; font-weight: 700; }

/* ============================================================
   ВИТРИНА ИГР
   ============================================================ */

.game-search { position: relative; margin-top: 16px; }
.game-search input { padding-left: 40px; }
.game-search::before {
  content: '⌕';
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-3);
  font-size: 19px;
  pointer-events: none;
}

.cat-bar { display: flex; gap: 6px; margin: 12px 0 4px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.cat-bar::-webkit-scrollbar { display: none; }

.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.game-tile {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
  cursor: pointer;
  transition: transform .16s, border-color .18s, background .18s;
  text-align: left;
  padding: 0;
  font: inherit;
  color: inherit;
  display: block;
}

.game-tile:hover { transform: translateY(-3px); border-color: var(--mint-dim); background: var(--panel-2); }
.game-tile:active { transform: translateY(-1px); }

.tile-art {
  height: 96px;
  display: grid;
  place-items: center;
  font-size: 40px;
  position: relative;
  overflow: hidden;
  background: linear-gradient(150deg, var(--panel-2), var(--panel-3));
}

/* Картинка перекрывает эмодзи: если она не загрузилась, остаётся эмодзи */
.tile-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .3s ease;
}
.game-tile:hover .tile-img { transform: scale(1.05); }
.tile-emoji { position: relative; z-index: 0; }

.tile-art[data-cat="multistep"] { background: linear-gradient(150deg, #14243a, #1b2c44); }
.tile-art[data-cat="crash"] { background: linear-gradient(150deg, #2a1730, #3a1f2c); }
.tile-art[data-cat="slots"] { background: linear-gradient(150deg, #2b2413, #35291a); }
.tile-art[data-cat="cards"] { background: linear-gradient(150deg, #10261f, #17332a); }
.tile-art[data-cat="table"] { background: linear-gradient(150deg, #201a33, #2a2242); }
.tile-art[data-cat="wheel"] { background: linear-gradient(150deg, #32211a, #3d2a20); }
.tile-art[data-cat="arcade"] { background: linear-gradient(150deg, #122b30, #17383e); }
.tile-art[data-cat="classic"] { background: linear-gradient(150deg, #1c2333, #232c40); }
.tile-art[data-cat="lottery"] { background: linear-gradient(150deg, #2d1a26, #38212f); }

.tile-body { padding: 10px 12px 12px; }
.tile-name { font-size: 13.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile-meta {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-top: 4px;
}
.tile-flag {
  position: absolute;
  top: 8px;
  right: 8px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .1em;
  padding: 3px 6px;
  border-radius: 5px;
  background: rgba(0, 0, 0, .42);
  color: var(--mint);
  text-transform: uppercase;
}

/* ============================================================
   ОКНА
   ============================================================ */

.overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(4, 7, 12, .82);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: fade .2s ease;
}

@media (min-width: 720px) { .overlay { align-items: center; padding: 24px; } }

@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.modal {
  width: 100%;
  max-width: 460px;
  max-height: 92vh;
  overflow-y: auto;
  overflow-x: hidden;
  /* Без min-width:0 флекс-элемент не сжимается уже своего содержимого
     и окно вылезает за край узкого экрана */
  min-width: 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  padding: 20px;
  animation: sheetUp .26s cubic-bezier(.2, .8, .3, 1);
}

@media (min-width: 720px) {
  .modal { border-radius: var(--r-lg); animation: popIn .22s cubic-bezier(.2, .8, .3, 1); }
}

@keyframes sheetUp { from { transform: translateY(28px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes popIn { from { transform: scale(.96); opacity: 0; } to { transform: none; opacity: 1; } }

.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.modal-title { font-size: 18px; font-weight: 700; letter-spacing: -.01em; }
.close-btn {
  width: 32px; height: 32px;
  border-radius: 9px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  color: var(--ink-2);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: grid; place-items: center;
  flex-shrink: 0;
}
.close-btn:hover { background: var(--panel-3); color: var(--ink); }

/* Пункт меню-шестерёнки */
.menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 13px 14px;
  margin-bottom: 8px;
  background: rgba(255, 255, 255, .03);
  border: 1px solid var(--line);
  border-radius: var(--r);
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background .18s, border-color .18s, transform .12s;
}
.menu-item:hover { background: rgba(18, 242, 166, .07); border-color: var(--mint-dim); }
.menu-item:active { transform: scale(.99); }
.mi-ico {
  width: 38px; height: 38px;
  flex-shrink: 0;
  border-radius: 11px;
  display: grid; place-items: center;
  font-size: 18px;
  background: var(--panel-3);
}
.mi-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.mi-text b { font-size: 14.5px; font-weight: 700; }
.mi-text small { font-size: 11.5px; color: var(--ink-3); }
.mi-arrow { color: var(--ink-3); font-size: 20px; flex-shrink: 0; }

.menu-head {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 14px 0 8px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 92px;
  transform: translateX(-50%) translateY(14px);
  z-index: 200;
  background: var(--panel-3);
  border: 1px solid var(--line);
  color: var(--ink);
  padding: 12px 18px;
  border-radius: 11px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s, transform .22s;
  max-width: min(92vw, 400px);
  text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.win { border-color: var(--mint-dim); background: linear-gradient(var(--panel-3), rgba(0, 229, 160, .12)); }
.toast.lose { border-color: rgba(255, 77, 94, .5); }

@media (min-width: 1000px) { .toast { bottom: 28px; } }

/* ============================================================
   ИГРОВОЕ ОКНО
   ============================================================ */

.game-modal {
  max-width: 520px;
  padding: 0;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.g-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 15px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-2);
  min-width: 0;
}
.g-title {
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.g-fair {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: .1em;
  color: var(--ink-3);
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 4px 8px;
  border-radius: 6px;
  cursor: pointer;
  text-transform: uppercase;
}
.g-fair:hover { color: var(--mint); border-color: var(--mint-dim); }

.g-stage {
  padding: 18px 16px;
  min-height: 190px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background:
    radial-gradient(100% 80% at 50% 0%, rgba(255, 255, 255, .022), transparent 70%),
    var(--panel);
}

.g-controls { padding: 14px 16px 18px; border-top: 1px solid var(--line); background: var(--panel-2); }

.g-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.g-stat { background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 9px 10px; text-align: center; }
.g-stat .k {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-3);
  display: block;
  margin-bottom: 4px;
}
.g-stat .v { font-family: var(--mono); font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.g-stat .v.accent { color: var(--mint); }

.g-fields { display: flex; gap: 10px; margin-bottom: 12px; }
.g-field { flex: 1; min-width: 0; }
.g-field label {
  display: block;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 6px;
}
.g-field input, .g-field select { padding: 11px 12px; font-size: 14px; }

.bet-quick { display: flex; gap: 6px; margin-bottom: 12px; }
.bet-quick button {
  flex: 1;
  padding: 7px 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  transition: background .16s, color .16s;
}
.bet-quick button:hover { background: var(--panel-3); color: var(--ink); }

.g-msg { text-align: center; font-size: 14px; font-weight: 600; min-height: 22px; margin: 10px 0 2px; color: var(--ink-2); }
.g-msg.win { color: var(--mint); }
.g-msg.lose { color: var(--ember); }
.g-msg.push { color: var(--gold); }

.choice-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.choice {
  flex: 1;
  min-width: 84px;
  padding: 11px 8px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--ink-2);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all .16s;
}
.choice:hover { border-color: var(--panel-3); color: var(--ink); }
.choice.on { background: var(--mint); border-color: var(--mint); color: #04120c; }

.result-panel { text-align: center; padding: 8px 0; }
.result-main {
  font-family: var(--mono);
  font-size: 40px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.03em;
  line-height: 1.1;
  animation: resultIn .32s cubic-bezier(.2, .9, .3, 1);
  word-break: break-word;
}
.result-main.win { color: var(--mint); }
.result-main.lose { color: var(--ink-2); }
.result-main.push { color: var(--gold); }
.result-main.sm { font-size: 26px; }
.result-sub { font-size: 13px; color: var(--ink-3); margin-top: 8px; }
.result-payout { font-family: var(--mono); font-size: 17px; font-weight: 700; margin-top: 12px; }

@keyframes resultIn { from { opacity: 0; transform: scale(.86); } to { opacity: 1; transform: none; } }

.idle-art { text-align: center; padding: 12px 0; }
.idle-art .big { font-size: 46px; opacity: .35; }
.idle-art p { font-size: 13px; color: var(--ink-3); margin-top: 12px; line-height: 1.5; }

/* ============================================================
   MINES — объёмные плитки с алмазами и минами
   ============================================================ */

.mines-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  max-width: 340px;
  margin: 0 auto;
  width: 100%;
  perspective: 700px;
}

.m-cell {
  aspect-ratio: 1;
  border: 0;
  padding: 0;
  background: none;
  cursor: pointer;
  position: relative;
  transform-style: preserve-3d;
  transition: transform .35s cubic-bezier(.3, .9, .4, 1.2);
}
.m-cell:disabled { cursor: default; }
.m-cell.flipped { transform: rotateY(180deg); }

.m-face {
  position: absolute;
  inset: 0;
  border-radius: 12px;
  display: grid;
  place-items: center;
  backface-visibility: hidden;
  overflow: hidden;
}

/* Закрытая плитка: объём за счёт светлой грани сверху и тени снизу */
.m-front {
  background: linear-gradient(180deg, #2c3a52, #202b3e 55%, #1a2333);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, .13),
    inset 0 -3px 0 rgba(0, 0, 0, .4),
    0 3px 6px rgba(0, 0, 0, .35);
  transition: transform .14s, box-shadow .18s;
}
.m-cell:not(:disabled):hover .m-front {
  transform: translateY(-3px);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, .2),
    inset 0 -3px 0 rgba(0, 0, 0, .4),
    0 8px 14px rgba(0, 0, 0, .45);
}
.m-cell:not(:disabled):active .m-front { transform: translateY(0); }

/* Точка-заклёпка по центру закрытой плитки */
.m-front::after {
  content: '';
  width: 7px; height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .1);
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, .5);
}

.m-back {
  transform: rotateY(180deg);
  background: linear-gradient(180deg, #16304a, #102437);
  box-shadow: inset 0 0 0 2px rgba(0, 229, 160, .45);
}
.m-back.mine {
  background: radial-gradient(circle at 50% 45%, #5a1c28, #2a0f16);
  box-shadow: inset 0 0 0 2px rgba(255, 77, 94, .55);
}
.m-back svg { width: 62%; height: 62%; }

.m-cell.hit .m-back.mine { animation: mineBlast .45s; }
.m-cell.ghost { opacity: .4; }

@keyframes mineBlast {
  0% { transform: rotateY(180deg) scale(1); }
  40% { transform: rotateY(180deg) scale(1.22); box-shadow: 0 0 26px 6px rgba(255, 77, 94, .6); }
  100% { transform: rotateY(180deg) scale(1); }
}

/* Вспышка по всему полю при подрыве */
.mines-wrap { position: relative; }
.mines-wrap.boom::after {
  content: '';
  position: absolute;
  inset: -12px;
  border-radius: 18px;
  background: radial-gradient(circle, rgba(255, 77, 94, .35), transparent 70%);
  animation: boomFlash .5s forwards;
  pointer-events: none;
}

@keyframes boomFlash {
  from { opacity: 1; }
  to { opacity: 0; }
}

@keyframes pop { 0% { transform: scale(.6); } 60% { transform: scale(1.12); } 100% { transform: scale(1); } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }

/* Crash */
.crash-stage { padding: 0; position: relative; background: #080d15; min-height: 0; }
.crash-canvas { width: 100%; height: clamp(210px, 34vh, 300px); display: block; }

/* Показания вынесены в нижнюю треть, чтобы ракета и парашюты их не перекрывали */
.crash-readout {
  position: absolute;
  left: 0; right: 0; bottom: 10px;
  display: grid;
  place-items: center;
  pointer-events: none;
  text-shadow: 0 2px 12px rgba(0, 0, 0, .95), 0 0 26px rgba(0, 0, 0, .8);
}
.crash-mult {
  font-family: var(--mono);
  font-size: 46px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.03em;
  text-shadow: 0 6px 30px rgba(0, 0, 0, .7);
}
.crash-mult.hot { color: var(--gold); }
.crash-mult.fire { color: var(--ember); }
.crash-mult.dead { color: var(--ember); animation: shake .4s; }
.crash-phase {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ink-3);
  text-align: center;
  margin-top: 8px;
}
/* ============================================================
   РАСКЛАДКА КРАШ-ИГРЫ: история слева, сцена в центре, ставки справа
   ============================================================ */

/* На узком экране сцена занимает всю ширину: боковые колонки прячутся,
   а история и ставки показываются под ней */
.crash-layout {
  display: grid;
  grid-template-columns: 1fr;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #080c16;
}
.crash-side, .crash-bets-side { display: none; }

/* Колонка истории — вертикальная, как в оригинале */
.crash-side {
  background: #0d1220;
  border-right: 1px solid var(--line);
  overflow-y: auto;
  max-height: 260px;
  scrollbar-width: none;
}
.crash-side::-webkit-scrollbar { display: none; }
.crash-side .h-pill {
  display: block;
  margin: 0;
  border-radius: 0;
  padding: 7px 4px;
  text-align: center;
  background: transparent;
  border-bottom: 1px solid rgba(255, 255, 255, .05);
  font-size: 12px;
}

.crash-main { position: relative; min-width: 0; }

/* Три колонки включаем только когда для сцены реально есть место */
@media (min-width: 1100px) {
  .crash-layout { grid-template-columns: 66px 1fr 210px; }
  .crash-side { display: block; }
  .crash-bets-side { display: block; }
  /* Селектор усилен, иначе объявленное ниже правило .crash-hist перебивает скрытие */
  .g-controls .crash-hist { display: none; }
  .crash-bets-side {
    border-left: 1px solid var(--line);
    background: #0d1220;
    max-height: 260px;
    overflow-y: auto;
  }
  .crash-bets-side .bets-panel { margin: 0; border: 0; border-radius: 0; background: transparent; }
  .crash-bets-side .bets-head { grid-template-columns: 1.2fr 1fr .8fr; }
  .crash-bets-side .bet-row { grid-template-columns: 1.2fr 1fr .8fr; font-size: 11.5px; padding: 7px 9px; }
  .crash-bets-side .bet-row span:nth-child(4),
  .crash-bets-side .bets-head span:nth-child(4) { display: none; }
  .bets-panel.below { display: none; }
}

/* Два поля ставки рядом, как в оригинале */
.bet-slots { display: grid; grid-template-columns: 1fr; gap: 10px; }

@media (min-width: 620px) {
  .bet-slots { grid-template-columns: 1fr 1fr; }
}

.bet-slot {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  background: var(--panel-2);
}

/* Панель ставок раунда */
.bets-panel {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: var(--panel);
}
.bets-head {
  display: grid;
  grid-template-columns: 1.4fr 1fr .9fr 1fr;
  gap: 8px;
  padding: 9px 12px;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-3);
  border-bottom: 1px solid var(--line);
  background: var(--panel-2);
}
.bets-rows { max-height: 190px; overflow-y: auto; }
.bet-row {
  display: grid;
  grid-template-columns: 1.4fr 1fr .9fr 1fr;
  gap: 8px;
  padding: 8px 12px;
  font-size: 12.5px;
  border-bottom: 1px solid var(--line-soft);
  align-items: center;
}
.bet-row:last-child { border-bottom: 0; }
.bet-row.mine { background: rgba(0, 229, 160, .08); }
.bet-row .n { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.bet-row.cashed { color: var(--mint); }
.bet-row.lost { color: var(--ink-3); }
.bets-empty { padding: 22px; text-align: center; color: var(--ink-3); font-size: 13px; }

.crash-online {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-2);
}
.crash-online b { color: var(--mint); }

.crash-hist { display: flex; gap: 5px; padding: 10px 16px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--line); }
.crash-hist::-webkit-scrollbar { display: none; }
.h-pill {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 99px;
  background: var(--panel-2);
  white-space: nowrap;
  flex-shrink: 0;
}
.h-pill.red { color: var(--ember); }
.h-pill.gold { color: var(--gold); }
.h-pill.green { color: var(--mint); }

/* Карты */
.hand { display: flex; gap: 7px; justify-content: center; flex-wrap: wrap; min-height: 92px; align-items: center; }
.pcard {
  width: 58px;
  height: 84px;
  border-radius: 8px;
  background: linear-gradient(160deg, #fdfdfd, #e6e9ef);
  color: #10161f;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 6px 7px;
  font-weight: 700;
  font-size: 14px;
  box-shadow: 0 6px 18px -6px rgba(0, 0, 0, .7);
  animation: dealIn .3s cubic-bezier(.2, .9, .3, 1) backwards;
  flex-shrink: 0;
}
.pcard.red { color: #d2264a; }
.pcard.back { background: repeating-linear-gradient(45deg, #1d2b44, #1d2b44 5px, #253654 5px, #253654 10px); }
.pcard .mid { text-align: center; font-size: 21px; }
.pcard .bot { text-align: right; transform: rotate(180deg); }
.pcard.held { outline: 2px solid var(--mint); outline-offset: 2px; }
.pcard.pick { cursor: pointer; }

@keyframes dealIn { from { opacity: 0; transform: translateY(-16px) rotate(-6deg); } to { opacity: 1; transform: none; } }

/* ============================================================
   VIDEO POKER — стол с картами и отметками «оставляю»
   ============================================================ */

.vp-table {
  border-radius: 14px;
  padding: 16px 10px 12px;
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(61, 139, 255, .12), transparent 62%),
    linear-gradient(180deg, #14243a, #0d1727);
}

.vp-hand { display: flex; gap: 7px; justify-content: center; flex-wrap: wrap; }

.vp-card {
  width: clamp(50px, 15vw, 66px);
  border-radius: 9px;
  background: linear-gradient(160deg, #fff, #e7ebf2);
  color: #16202f;
  padding: 7px 8px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  font-weight: 800;
  font-size: 13px;
  cursor: pointer;
  position: relative;
  box-shadow: 0 6px 16px rgba(0, 0, 0, .5);
  transition: transform .18s, box-shadow .18s;
  animation: dealIn .3s cubic-bezier(.2, .9, .3, 1) backwards;
}
.vp-card.red { color: #d2264a; }
.vp-card .mid { font-size: clamp(20px, 6vw, 28px); text-align: center; align-self: center; }
.vp-card .bot { transform: rotate(180deg); text-align: right; }
.vp-card:hover { transform: translateY(-4px); }

/* Отметка HOLD над оставленной картой */
.vp-card.held {
  transform: translateY(-8px);
  box-shadow: 0 10px 22px rgba(0, 0, 0, .55), 0 0 0 3px var(--mint);
}
.vp-card.held::before {
  content: 'HOLD';
  position: absolute;
  top: -20px; left: 50%;
  transform: translateX(-50%);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .1em;
  color: #04120c;
  background: var(--mint);
  padding: 2px 7px;
  border-radius: 5px;
}

.vp-paytable {
  margin-top: 14px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .08);
}
.vp-row {
  display: flex;
  justify-content: space-between;
  padding: 5px 11px;
  font-size: 12px;
  background: rgba(255, 255, 255, .03);
}
.vp-row:nth-child(even) { background: rgba(255, 255, 255, .06); }
.vp-row.win { background: rgba(0, 229, 160, .2); color: var(--mint); font-weight: 700; }
.vp-row b { font-family: var(--mono); }

/* ============================================================
   HI-LO — стол с колодой и крупной картой
   ============================================================ */

.hilo {
  display: grid;
  place-items: center;
  padding: 14px 0 6px;
  border-radius: 14px;
  background:
    radial-gradient(120% 90% at 50% 10%, rgba(0, 229, 160, .1), transparent 62%),
    linear-gradient(180deg, #0f2a22, #0b1a16);
  position: relative;
}

.hilo-stage { position: relative; height: 150px; display: grid; place-items: center; width: 100%; }

/* Колода за картой: три смещённые рубашки */
.deck-back {
  position: absolute;
  width: 92px; height: 130px;
  border-radius: 10px;
  background: repeating-linear-gradient(45deg, #1d2b44, #1d2b44 6px, #27395a 6px, #27395a 12px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, .5);
}
.deck-back.d1 { transform: translate(-58px, 6px) rotate(-8deg); opacity: .55; }
.deck-back.d2 { transform: translate(-50px, 3px) rotate(-4deg); opacity: .75; }

.hilo-card {
  position: relative;
  width: 100px; height: 142px;
  border-radius: 11px;
  background: linear-gradient(160deg, #fff, #e7ebf2);
  color: #16202f;
  box-shadow: 0 10px 26px rgba(0, 0, 0, .55);
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: 9px 11px;
  font-weight: 800;
  animation: cardFlip .45s cubic-bezier(.3, .9, .35, 1.1);
}
.hilo-card.red { color: #d2264a; }
.hilo-card .corner { font-size: 19px; line-height: 1; }
.hilo-card .corner.bottom { transform: rotate(180deg); text-align: right; }
.hilo-card .pip { font-size: 46px; text-align: center; line-height: 1; align-self: center; }

@keyframes cardFlip {
  0% { transform: rotateY(90deg) scale(.9); opacity: 0; }
  100% { transform: none; opacity: 1; }
}

/* Лента открытых карт */
.hilo-history {
  display: flex;
  gap: 5px;
  justify-content: center;
  flex-wrap: wrap;
  padding: 10px 8px 2px;
}
.hilo-chip {
  min-width: 30px;
  padding: 3px 6px;
  border-radius: 6px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  background: rgba(255, 255, 255, .08);
  color: var(--ink-2);
}
.hilo-chip.red { color: #ff7a90; }
.hilo-chip.miss { background: rgba(255, 77, 94, .25); color: #ffc2ca; }

.hand-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-3);
  text-align: center;
  margin-bottom: 8px;
}
.hand-label b { color: var(--ink); font-size: 13px; }

/* ============================================================
   CHICKEN ROAD — дорога с полосами, курицей и машинами
   ============================================================ */

.road {
  position: relative;
  width: 100%;
  border-radius: 14px;
  overflow: hidden;
  background: linear-gradient(180deg, #0b1526 0%, #16233a 38%, #1b2942 100%);
  padding: 10px 0 0;
  user-select: none;
}

/* Полоса неба с фонарями над дорогой */
.road-sky {
  height: 34px;
  position: relative;
  background: linear-gradient(180deg, #0a1220, #101c2e);
  border-bottom: 1px solid rgba(255, 255, 255, .06);
}
.road-lamp {
  position: absolute;
  bottom: 0;
  width: 2px;
  height: 20px;
  background: rgba(255, 255, 255, .18);
}
.road-lamp::after {
  content: '';
  position: absolute;
  top: -4px; left: -3px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 12px 3px rgba(255, 194, 75, .45);
}

.road-lanes {
  display: flex;
  position: relative;
  height: 190px;
  background: linear-gradient(180deg, #5f6166, #55575c 60%, #4c4e53);
  overflow: hidden;
}

/* Полоса дороги: пунктирная разметка по правому краю */
.lane {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .25s;
  min-width: 0;
}
.lane::after {
  content: '';
  position: absolute;
  right: -1px; top: 0; bottom: 0;
  width: 3px;
  background: repeating-linear-gradient(180deg,
    rgba(255, 255, 255, .85) 0 16px, transparent 16px 30px);
}
.lane:last-child::after { display: none; }
.lane.passed { background: rgba(0, 229, 160, .1); }
.lane.current { background: rgba(255, 255, 255, .06); }
.lane.crashed { background: rgba(255, 77, 94, .22); }

/* Люк с коэффициентом — как в оригинале */
.manhole {
  width: min(72px, 84%);
  aspect-ratio: 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
  position: relative;
  background:
    repeating-linear-gradient(90deg, rgba(0,0,0,.30) 0 3px, transparent 3px 7px),
    radial-gradient(circle at 38% 32%, #6e7176, #3f4247 72%, #303236);
  box-shadow: inset 0 0 0 4px rgba(255, 255, 255, .07), 0 3px 8px rgba(0, 0, 0, .4);
  transition: transform .25s, box-shadow .25s, background .25s;
}
.lane.passed .manhole {
  background:
    repeating-linear-gradient(90deg, rgba(0,0,0,.22) 0 3px, transparent 3px 7px),
    radial-gradient(circle at 38% 32%, #f2c661, #d79f2e 70%, #b8831f);
  box-shadow: inset 0 0 0 4px rgba(255, 255, 255, .22), 0 0 16px rgba(255, 194, 75, .4);
}
.lane.current .manhole {
  transform: scale(1.06);
  box-shadow: inset 0 0 0 4px rgba(255, 255, 255, .2), 0 0 18px rgba(255, 255, 255, .18);
}

.manhole span {
  font-family: var(--mono);
  font-size: clamp(11px, 2.6vw, 16px);
  font-weight: 700;
  color: #cfd4dc;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .6);
  letter-spacing: -.02em;
}
.lane.passed .manhole span { color: #3a2a06; text-shadow: none; }

/* Табличка с текущим множителем под курицей */
.mult-tag {
  position: absolute;
  bottom: 4px;
  transform: translateX(-50%);
  background: #3f5c92;
  color: #fff;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 15px;
  padding: 5px 12px;
  border-radius: 8px;
  box-shadow: 0 3px 0 #2b4068, 0 6px 12px rgba(0, 0, 0, .45);
  z-index: 4;
  white-space: nowrap;
  transition: left .45s cubic-bezier(.34, 1.3, .5, 1);
}
.mult-tag::before {
  content: '';
  position: absolute;
  top: -7px; left: 50%;
  transform: translateX(-50%);
  border: 7px solid transparent;
  border-bottom-color: #3f5c92;
  border-top: 0;
}

/* Обочина, с которой курица стартует */
.road-curb {
  height: 12px;
  background: repeating-linear-gradient(90deg, #d8dee9 0 14px, #b23b3b 14px 28px);
  opacity: .5;
}

.chicken {
  position: absolute;
  bottom: 46px;
  width: clamp(52px, 13vw, 76px);
  height: clamp(52px, 13vw, 76px);
  transform: translateX(-50%);
  transition: left .45s cubic-bezier(.34, 1.3, .5, 1), bottom .3s;
  z-index: 3;
  will-change: left;
}
.chicken svg { display: block; width: 100%; height: 100%; }
.chicken.walking { animation: chickenBob .35s ease-in-out infinite alternate; }
.chicken.dead { animation: chickenHit .5s forwards; }

@keyframes chickenBob {
  from { transform: translateX(-50%) translateY(0); }
  to { transform: translateX(-50%) translateY(-4px); }
}
@keyframes chickenHit {
  0% { transform: translateX(-50%) scale(1) rotate(0); }
  35% { transform: translateX(-50%) scale(1.15) rotate(-18deg); }
  100% { transform: translateX(-50%) scale(.55) rotate(-90deg); opacity: .35; }
}

/* Машины едут поперёк полос */
.car {
  position: absolute;
  width: clamp(26px, 6.5vw, 40px);
  height: clamp(46px, 11vw, 66px);
  border-radius: 9px;
  z-index: 2;
  transform: translateX(-50%);
  animation: carDrive linear infinite;
}
.car i {
  position: absolute;
  left: 4px; right: 4px;
  height: 10px;
  border-radius: 3px;
  background: rgba(255, 255, 255, .22);
}
.car i.roof { top: 14px; bottom: 14px; height: auto; }
.car::before, .car::after {
  content: '';
  position: absolute;
  left: 5px; right: 5px;
  height: 5px;
  border-radius: 3px;
  background: rgba(255, 236, 170, .85);
}
.car::before { top: 2px; }
.car::after { bottom: 2px; background: rgba(255, 90, 90, .8); }

@keyframes carDrive {
  from { top: -60px; }
  to { top: 150px; }
}

.feathers {
  position: absolute;
  bottom: 26px;
  z-index: 4;
  transform: translateX(-50%);
  pointer-events: none;
}
.feathers span {
  position: absolute;
  font-size: 13px;
  animation: featherFly .9s ease-out forwards;
}

@keyframes featherFly {
  from { opacity: 1; transform: translate(0, 0) rotate(0); }
  to { opacity: 0; transform: translate(var(--fx), var(--fy)) rotate(var(--fr)); }
}

.road-hud {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 10px;
  padding: 12px 0 4px;
}
.road-mult {
  font-family: var(--mono);
  font-size: 34px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.02em;
}
.road-mult.win { color: var(--mint); }
.road-mult.lose { color: var(--ember); }
.road-note { font-size: 13px; color: var(--ink-3); text-align: center; padding-bottom: 4px; }

/* Дорога / этажи */
.track { display: flex; align-items: center; justify-content: center; gap: 3px; flex-wrap: wrap; margin-bottom: 16px; }
.step-dot {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--panel-3);
  border: 1px solid var(--line);
  display: grid; place-items: center;
  font-family: var(--mono);
  font-size: 11px; font-weight: 700;
  color: var(--ink-3);
  flex-shrink: 0;
  transition: all .2s;
}
.step-dot.done { background: rgba(0, 229, 160, .16); border-color: var(--mint-dim); color: var(--mint); }
.step-dot.now { background: var(--gold); border-color: var(--gold); color: #191203; box-shadow: 0 0 0 4px rgba(255, 194, 75, .16); }
.step-line { width: 12px; height: 2px; background: var(--line); flex-shrink: 0; }
.step-line.done { background: var(--mint-dim); }

/* ============================================================
   DRAGON TOWER — каменная башня с этажами
   ============================================================ */

.tower {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
  padding: 10px;
  border-radius: 14px;
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(139, 124, 255, .16), transparent 60%),
    linear-gradient(180deg, #131a2a, #0d1220);
}

.tower-row {
  display: flex;
  gap: 6px;
  align-items: center;
  opacity: .45;
  transition: opacity .25s, transform .25s;
}
.tower-row.passed { opacity: .85; }
.tower-row.active { opacity: 1; transform: scale(1.03); }

.tower-mult {
  width: 54px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-3);
  text-align: right;
  flex-shrink: 0;
}
.tower-row.active .tower-mult { color: var(--gold); }
.tower-row.passed .tower-mult { color: var(--mint); }

/* Плитка — каменный блок с фаской */
.tower-tile {
  width: clamp(44px, 12vw, 62px);
  height: 38px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: 17px;
  cursor: default;
  position: relative;
  background: linear-gradient(180deg, #38445c, #232c3e 60%, #1b2231);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, .12),
    inset 0 -3px 0 rgba(0, 0, 0, .45),
    0 3px 6px rgba(0, 0, 0, .35);
  transition: transform .16s, box-shadow .2s, background .25s;
}
.tower-tile::after {
  content: '';
  position: absolute;
  inset: 5px 8px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, .05);
}

.tower-row.active .tower-tile { cursor: pointer; }
.tower-row.active .tower-tile:hover {
  transform: translateY(-3px);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, .22),
    inset 0 -3px 0 rgba(0, 0, 0, .45),
    0 8px 14px rgba(0, 0, 0, .45);
}

.tower-tile.safe {
  background: linear-gradient(180deg, #17604a, #0f3a2c);
  box-shadow: inset 0 0 0 2px rgba(0, 229, 160, .5), 0 0 14px rgba(0, 229, 160, .25);
}
.tower-tile.trap {
  background: linear-gradient(180deg, #6b1f2c, #3a1018);
  box-shadow: inset 0 0 0 2px rgba(255, 77, 94, .55);
}
.tower-tile.picked { animation: pop .3s cubic-bezier(.2, .9, .3, 1); }
.tower-tile svg { width: 24px; height: 24px; }

.tower-top {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ink-3);
  padding-bottom: 4px;
}

/* Слоты */
/* ============================================================
   СЛОТЫ — барабаны с настоящим вращением
   ============================================================ */

.slot-machine {
  max-width: 380px;
  margin: 0 auto;
  width: 100%;
  border-radius: 16px;
  padding: 12px;
  background: linear-gradient(180deg, #2a2113, #1b1610);
  box-shadow: inset 0 0 0 2px rgba(255, 194, 75, .28), 0 8px 22px rgba(0, 0, 0, .5);
}

.reels {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 5px;
  background: #0a0d14;
  border-radius: 11px;
  padding: 7px;
  box-shadow: inset 0 3px 10px rgba(0, 0, 0, .7);
}

/* Окно барабана: полоса символов ездит внутри него */
.reel {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  background: linear-gradient(180deg, #171f2c, #10161f);
  aspect-ratio: 1 / 3;
}
.reel::before, .reel::after {
  content: '';
  position: absolute;
  left: 0; right: 0;
  height: 22%;
  z-index: 2;
  pointer-events: none;
}
.reel::before { top: 0; background: linear-gradient(180deg, rgba(0,0,0,.75), transparent); }
.reel::after { bottom: 0; background: linear-gradient(0deg, rgba(0,0,0,.75), transparent); }

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

.slot-cell {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  font-size: clamp(17px, 5.6vw, 26px);
  flex-shrink: 0;
  transition: background .25s, box-shadow .25s, transform .25s;
  border-radius: 6px;
}
.slot-cell.hit {
  background: rgba(0, 229, 160, .2);
  box-shadow: inset 0 0 0 2px var(--mint);
  transform: scale(1.06);
  animation: winPulse 1s ease-in-out infinite alternate;
}

@keyframes winPulse {
  from { box-shadow: inset 0 0 0 2px var(--mint); }
  to { box-shadow: inset 0 0 0 2px var(--mint), 0 0 14px rgba(0, 229, 160, .55); }
}

/* Вращение: полоса едет вверх и размывается */
.reel-strip.spinning { animation: reelRoll var(--spin, .9s) cubic-bezier(.25, .1, .2, 1) forwards; }

@keyframes reelRoll {
  0% { transform: translateY(calc(-100% + 300%)); filter: blur(0); }
  12% { filter: blur(4px); }
  82% { filter: blur(2px); }
  100% { transform: translateY(0); filter: blur(0); }
}

.slot-payline {
  text-align: center;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .1em;
  color: var(--gold);
  text-transform: uppercase;
  margin-top: 10px;
  min-height: 15px;
}

/* ============================================================
   КЛАССИКА — монета, лимбо, напёрстки, барабан, цвет
   ============================================================ */

.classic-stage {
  border-radius: 14px;
  padding: 18px 12px 14px;
  text-align: center;
  background:
    radial-gradient(110% 80% at 50% 8%, rgba(255, 255, 255, .07), transparent 62%),
    linear-gradient(180deg, #1b2233, #0f1420);
}

/* Монета */
.coin3d {
  width: 96px; height: 96px;
  margin: 0 auto;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 38px;
  font-weight: 800;
  color: #4a3406;
  background: radial-gradient(circle at 34% 28%, #ffe08a, #d9a127 62%, #a87a15);
  box-shadow: inset 0 -5px 8px rgba(0, 0, 0, .3), inset 0 4px 6px rgba(255, 255, 255, .5), 0 8px 18px rgba(0, 0, 0, .5);
  animation: coinSpin .8s cubic-bezier(.25, .8, .3, 1);
}
.coin3d.tails { background: radial-gradient(circle at 34% 28%, #dfe6f2, #9aa7bd 62%, #74809a); color: #1e2635; }

@keyframes coinSpin {
  0% { transform: rotateY(0) scale(.7); }
  60% { transform: rotateY(900deg) scale(1.1); }
  100% { transform: rotateY(1080deg) scale(1); }
}

/* Полоска множителя для лимбо */
.limbo-gauge {
  height: 12px;
  border-radius: 99px;
  background: rgba(255, 255, 255, .08);
  overflow: hidden;
  margin: 16px 12px 8px;
  position: relative;
}
.limbo-fill {
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--mint), var(--gold), var(--ember));
  animation: limboGrow .7s cubic-bezier(.2, .9, .3, 1);
}
.limbo-target {
  position: absolute;
  top: -4px; bottom: -4px;
  width: 3px;
  background: #fff;
  border-radius: 2px;
  box-shadow: 0 0 6px rgba(255, 255, 255, .8);
}

@keyframes limboGrow { from { width: 0; } }

/* Напёрстки */
.cups-row { display: flex; gap: 20px; justify-content: center; align-items: flex-end; }
.cup {
  width: 62px; height: 68px;
  border-radius: 8px 8px 26px 26px;
  background: linear-gradient(180deg, #d94a5c, #8e1f2e);
  box-shadow: inset 0 4px 0 rgba(255, 255, 255, .25), 0 6px 14px rgba(0, 0, 0, .5);
  position: relative;
  transition: transform .35s cubic-bezier(.2, 1.3, .5, 1);
}
.cup.lifted { transform: translateY(-30px) rotate(-8deg); }
.cup-ball {
  position: absolute;
  bottom: -6px; left: 50%;
  transform: translateX(-50%);
  width: 22px; height: 22px;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 28%, #ffe08a, #d9a127);
  box-shadow: 0 3px 6px rgba(0, 0, 0, .5);
}

/* Барабан револьвера */
.cylinder {
  width: 130px; height: 130px;
  margin: 0 auto;
  border-radius: 50%;
  position: relative;
  background: radial-gradient(circle at 36% 30%, #4a5468, #232a38 70%);
  box-shadow: inset 0 0 0 4px rgba(255, 255, 255, .08), 0 6px 16px rgba(0, 0, 0, .5);
}
.chamber {
  position: absolute;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: #10151f;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, .8);
  transform: translate(-50%, -50%);
}
.chamber.live { background: radial-gradient(circle at 36% 30%, #ffc24b, #a8760f); }
.chamber.hit { box-shadow: 0 0 0 3px var(--ember), inset 0 2px 4px rgba(0, 0, 0, .6); }

/* Цветной шар */
.colour-ball {
  width: 92px; height: 92px;
  margin: 0 auto;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-size: 38px;
  font-weight: 700;
  color: #fff;
  box-shadow: inset 0 -5px 10px rgba(0, 0, 0, .35), 0 8px 18px rgba(0, 0, 0, .5);
  animation: pop .4s cubic-bezier(.2, .9, .3, 1);
}

/* ============================================================
   КУБИКИ — общее для сик бо, дуэли, Lucky 7 и прочих
   ============================================================ */

.dice-table {
  border-radius: 14px;
  padding: 18px 12px 12px;
  background:
    radial-gradient(110% 80% at 50% 8%, rgba(255, 255, 255, .07), transparent 62%),
    linear-gradient(180deg, #14563c, #0b2f21);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .06);
}

.dice-row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

.die {
  width: clamp(46px, 14vw, 62px);
  aspect-ratio: 1;
  border-radius: 12px;
  background: linear-gradient(160deg, #fff, #dfe4ec);
  box-shadow:
    inset 0 -4px 0 rgba(0, 0, 0, .14),
    inset 0 2px 0 rgba(255, 255, 255, .9),
    0 6px 14px rgba(0, 0, 0, .5);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  padding: 16%;
  gap: 6%;
  animation: dieRoll .55s cubic-bezier(.28, .9, .35, 1.15) backwards;
}
.die i {
  border-radius: 50%;
  background: #16202f;
  box-shadow: inset 0 -1px 1px rgba(255, 255, 255, .3);
}
.die.house { background: linear-gradient(160deg, #ff8a97, #d94a5c); }
.die.house i { background: #4a0f18; }

@keyframes dieRoll {
  0% { transform: rotate(-160deg) scale(.5); opacity: 0; }
  70% { transform: rotate(12deg) scale(1.08); opacity: 1; }
  100% { transform: none; }
}

.dice-sum {
  text-align: center;
  margin-top: 14px;
  font-family: var(--mono);
  font-size: 30px;
  font-weight: 700;
}
.dice-sum small {
  display: block;
  font-size: 10px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .5);
  margin-top: 3px;
}
.dice-vs {
  text-align: center;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .14em;
  color: rgba(255, 255, 255, .45);
  margin: 10px 0;
}
.dice-badge {
  display: inline-block;
  margin-top: 10px;
  padding: 4px 12px;
  border-radius: 99px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  background: rgba(255, 194, 75, .2);
  color: var(--gold);
}

/* ============================================================
   PLINKO — доска со штырьками и корзинами
   ============================================================ */

.plinko-wrap {
  display: flex;
  justify-content: center;
  border-radius: 14px;
  padding: 10px 6px 6px;
  background:
    radial-gradient(110% 80% at 50% 0%, rgba(61, 139, 255, .12), transparent 62%),
    linear-gradient(180deg, #131c2e, #0b1220);
}
.plinko { display: block; max-width: 100%; }

.buckets {
  display: flex;
  gap: 3px;
  justify-content: center;
  margin-top: 10px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 2px;
}
.buckets::-webkit-scrollbar { display: none; }

.bucket {
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 700;
  padding: 6px 4px;
  border-radius: 5px 5px 3px 3px;
  color: #14202f;
  min-width: 30px;
  text-align: center;
  flex-shrink: 0;
  transition: transform .25s cubic-bezier(.2, 1.4, .5, 1), box-shadow .25s;
  /* Цвет задаётся из кода по величине множителя */
}
.bucket.hot {
  transform: translateY(-8px) scale(1.14);
  box-shadow: 0 6px 16px rgba(0, 0, 0, .55), 0 0 0 2px #fff inset;
}

/* ============================================================
   КОЛЕСО — общее для трёх игр
   ============================================================ */

.wheel-wrap {
  display: grid;
  place-items: center;
  position: relative;
  padding: 12px 0 6px;
  border-radius: 14px;
  background:
    radial-gradient(100% 80% at 50% 15%, rgba(255, 194, 75, .12), transparent 65%),
    linear-gradient(180deg, #1d1526, #100b18);
}

.wheel-svg {
  max-width: 240px;
  width: 100%;
  transition: transform 3.6s cubic-bezier(.12, .72, .12, 1);
  filter: drop-shadow(0 8px 22px rgba(0, 0, 0, .6));
}

/* Указатель сверху */
.wheel-ptr {
  position: absolute;
  top: 4px;
  z-index: 2;
  width: 0; height: 0;
  border-left: 11px solid transparent;
  border-right: 11px solid transparent;
  border-top: 20px solid var(--gold);
  filter: drop-shadow(0 3px 5px rgba(0, 0, 0, .6));
}

.wheel-result {
  margin-top: 10px;
  font-family: var(--mono);
  font-size: 26px;
  font-weight: 700;
  min-height: 30px;
}
.wheel-result.win { color: var(--mint); }
.wheel-result.lose { color: var(--ink-3); }

/* ============================================================
   РУЛЕТКА — барабан с числами
   ============================================================ */

.roulette-wrap {
  display: grid;
  place-items: center;
  padding: 14px 0 8px;
  border-radius: 14px;
  background:
    radial-gradient(100% 80% at 50% 12%, rgba(0, 229, 160, .1), transparent 62%),
    linear-gradient(180deg, #14563c, #0a2a1e);
}

.roulette-ball {
  width: 88px; height: 88px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-size: 34px;
  font-weight: 700;
  color: #fff;
  box-shadow: inset 0 0 0 4px rgba(255, 255, 255, .22), 0 8px 20px rgba(0, 0, 0, .55);
  animation: pop .4s cubic-bezier(.2, .9, .3, 1);
}
.roulette-ball.red { background: radial-gradient(circle at 36% 30%, #e05264, #a8102a); }
.roulette-ball.black { background: radial-gradient(circle at 36% 30%, #3b4658, #141a26); }
.roulette-ball.green { background: radial-gradient(circle at 36% 30%, #2ad39b, #0b7a58); }

.roulette-strip { display: flex; gap: 4px; justify-content: center; flex-wrap: wrap; margin-top: 12px; }
.rt-num {
  width: 26px; height: 26px;
  border-radius: 5px;
  display: grid; place-items: center;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  color: rgba(255, 255, 255, .85);
}
.rt-num.red { background: #a8102a; }
.rt-num.black { background: #1a2230; }
.rt-num.green { background: #0b7a58; }
.rt-num.hit { outline: 2px solid var(--gold); outline-offset: 1px; transform: scale(1.15); }

/* ============================================================
   ЛОТЕРЕИ — шары с числами
   ============================================================ */

.lotto-table {
  border-radius: 14px;
  padding: 14px 12px 12px;
  background:
    radial-gradient(110% 80% at 50% 8%, rgba(139, 124, 255, .14), transparent 62%),
    linear-gradient(180deg, #221a3a, #120e20);
}

.lotto-title {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .5);
  text-align: center;
  margin-bottom: 10px;
}

.numgrid { display: grid; gap: 5px; }
.numgrid.k40 { grid-template-columns: repeat(8, 1fr); max-width: 330px; margin: 0 auto; }
.numgrid.k45 { grid-template-columns: repeat(9, 1fr); max-width: 340px; margin: 0 auto; }
.numgrid.k9 { grid-template-columns: repeat(3, 1fr); max-width: 190px; margin: 0 auto; gap: 8px; }

/* Шар: объём за счёт блика сверху и тени снизу */
.ncell {
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 28%, #3b4763, #1c2434 72%);
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-size: clamp(9px, 2.6vw, 12px);
  font-weight: 700;
  color: rgba(255, 255, 255, .35);
  box-shadow: inset 0 -2px 3px rgba(0, 0, 0, .45);
  transition: transform .2s, box-shadow .2s, background .2s, color .2s;
}
.numgrid.k9 .ncell { font-size: clamp(13px, 4.5vw, 18px); }

/* Выбранный игроком */
.ncell.pick {
  background: radial-gradient(circle at 34% 28%, #6ea4ff, #26508f 72%);
  color: #fff;
  box-shadow: inset 0 -2px 3px rgba(0, 0, 0, .35), 0 0 0 2px rgba(110, 164, 255, .4);
}
/* Выпал в тираже */
.ncell.drawn {
  background: radial-gradient(circle at 34% 28%, #8f8aa6, #4a4560 72%);
  color: #fff;
}
/* Совпадение — выбран и выпал */
.ncell.hit {
  background: radial-gradient(circle at 34% 28%, #7dffd4, #0a9c73 72%);
  color: #03251b;
  transform: scale(1.12);
  box-shadow: 0 0 16px rgba(0, 229, 160, .55);
  animation: pop .3s cubic-bezier(.2, .9, .3, 1);
}

.lotto-legend {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 12px;
  font-size: 11px;
  color: rgba(255, 255, 255, .55);
}
.lotto-legend span { display: flex; align-items: center; gap: 5px; }
.lotto-legend i {
  width: 11px; height: 11px;
  border-radius: 50%;
  display: inline-block;
}
.lotto-legend i.p { background: #4a7fd4; }
.lotto-legend i.d { background: #6b6680; }
.lotto-legend i.h { background: #0fd9a8; }

/* ============================================================
   КАРТОЧНЫЙ СТОЛ — общий для баккары, дракон-тигра, андар-бахара,
   казино-войны, ред-дога, трёхкарточного покера и цвета карты
   ============================================================ */

.card-table {
  border-radius: 14px;
  padding: 14px 12px 10px;
  background:
    radial-gradient(130% 90% at 50% 0%, rgba(255, 255, 255, .07), transparent 62%),
    linear-gradient(180deg, #123b52, #0b2333);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .06);
}
.card-table.felt-green {
  background:
    radial-gradient(130% 90% at 50% 0%, rgba(255, 255, 255, .07), transparent 62%),
    linear-gradient(180deg, #14563c, #0c3325);
}
.card-table.felt-red {
  background:
    radial-gradient(130% 90% at 50% 0%, rgba(255, 255, 255, .07), transparent 62%),
    linear-gradient(180deg, #5a1b2a, #33101a);
}

.ct-box { padding: 5px 0; }
.ct-box + .ct-box { border-top: 1px dashed rgba(255, 255, 255, .14); margin-top: 8px; }

.ct-label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .55);
  margin-bottom: 8px;
}
.ct-val {
  padding: 2px 9px;
  border-radius: 99px;
  background: rgba(0, 0, 0, .4);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
}
.ct-val.win { background: var(--mint); color: #04120c; }

.ct-cards { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; min-height: 90px; align-items: center; }

/* Две колонки для дракона против тигра */
.ct-duel { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; }
.ct-vs {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .12em;
  color: rgba(255, 255, 255, .5);
}

/* ============================================================
   BLACKJACK — сукно, дилер сверху, игрок снизу
   ============================================================ */

.bj-table {
  border-radius: 14px;
  padding: 14px 12px;
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(255, 255, 255, .06), transparent 60%),
    linear-gradient(180deg, #14563c, #0c3325);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .07);
}

.bj-side { padding: 6px 0; }
.bj-side + .bj-side { border-top: 1px dashed rgba(255, 255, 255, .14); margin-top: 8px; }

.bj-head {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  margin-bottom: 8px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .55);
}
.bj-score {
  min-width: 30px;
  padding: 2px 9px;
  border-radius: 99px;
  background: rgba(0, 0, 0, .4);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
}
.bj-score.bust { background: var(--ember); }
.bj-score.win { background: var(--mint); color: #04120c; }

.bj-cards { display: flex; gap: 6px; justify-content: center; min-height: 96px; align-items: center; }

.bj-card {
  width: clamp(54px, 16vw, 66px);
  height: clamp(78px, 23vw, 94px);
  border-radius: 9px;
  background: linear-gradient(160deg, #fff, #e7ebf2);
  color: #16202f;
  padding: 6px 7px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  font-weight: 800;
  font-size: 13px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, .5);
  animation: dealIn .32s cubic-bezier(.2, .9, .3, 1) backwards;
  flex-shrink: 0;
}
.bj-card.red { color: #d2264a; }
.bj-card .mid { font-size: clamp(20px, 6vw, 26px); text-align: center; align-self: center; }
.bj-card .bot { transform: rotate(180deg); text-align: right; }
.bj-card.back {
  background: repeating-linear-gradient(45deg, #1d2b44, #1d2b44 6px, #27395a 6px, #27395a 12px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, .5), inset 0 0 0 3px rgba(255, 255, 255, .1);
}

.bj-verdict {
  text-align: center;
  margin-top: 10px;
  font-size: 15px;
  font-weight: 700;
}
.bj-verdict.win { color: var(--mint); }
.bj-verdict.lose { color: var(--ember); }
.bj-verdict.push { color: var(--gold); }

/* ============================================================
   GOAL — ворота, вратарь и мяч
   ============================================================ */

.pitch {
  border-radius: 14px;
  padding: 14px 12px 10px;
  background:
    repeating-linear-gradient(90deg, rgba(255,255,255,.03) 0 26px, transparent 26px 52px),
    linear-gradient(180deg, #1a5c38, #0f3a24);
}

.goal-frame {
  position: relative;
  height: 130px;
  border: 4px solid #f2f5fa;
  border-bottom: 0;
  border-radius: 6px 6px 0 0;
  background:
    repeating-linear-gradient(90deg, rgba(255,255,255,.16) 0 1px, transparent 1px 15px),
    repeating-linear-gradient(180deg, rgba(255,255,255,.16) 0 1px, transparent 1px 15px),
    rgba(0, 0, 0, .22);
  display: flex;
}

/* Три створа ворот */
.goal-zone {
  flex: 1;
  position: relative;
  display: grid;
  place-items: end center;
  padding-bottom: 8px;
  cursor: pointer;
  transition: background .2s;
}
.goal-zone:hover { background: rgba(255, 255, 255, .07); }
.goal-zone.scored { background: rgba(0, 229, 160, .16); }
.goal-zone.saved { background: rgba(255, 77, 94, .2); }
.goal-zone span {
  font-size: 24px;
  opacity: .5;
  transition: opacity .2s, transform .2s;
}
.goal-zone:hover span { opacity: 1; transform: translateY(-4px); }

/* Вратарь */
.keeper {
  position: absolute;
  bottom: 6px;
  width: 44px; height: 54px;
  transition: left .35s cubic-bezier(.3, 1.2, .5, 1);
  transform: translateX(-50%);
  z-index: 2;
}
.keeper svg { width: 100%; height: 100%; }

.ball {
  position: absolute;
  bottom: 4px;
  width: 24px; height: 24px;
  transform: translateX(-50%);
  transition: bottom .4s ease-out, left .4s ease-out;
  z-index: 3;
}
.ball svg { width: 100%; height: 100%; }

.goal-ground { height: 10px; background: linear-gradient(180deg, #f2f5fa, #c8d0dc); border-radius: 0 0 5px 5px; }

.goal-shots { display: flex; gap: 5px; justify-content: center; padding-top: 10px; flex-wrap: wrap; }
.shot-pill {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 99px;
  background: rgba(255, 255, 255, .1);
  color: var(--ink-2);
}
.shot-pill.goal { background: rgba(0, 229, 160, .22); color: var(--mint); }
.shot-pill.save { background: rgba(255, 77, 94, .22); color: var(--ember); }

/* ============================================================
   BALLOON — шар с насосом
   ============================================================ */

.balloon-art {
  text-align: center;
  border-radius: 14px;
  padding: 14px 0 8px;
  background:
    radial-gradient(120% 80% at 50% 15%, rgba(255, 194, 75, .12), transparent 65%),
    linear-gradient(180deg, #16203a, #0d1424);
  position: relative;
  overflow: hidden;
}

.balloon-stage { height: 190px; display: grid; place-items: center; position: relative; }

.balloon-body {
  width: 150px;
  height: 150px;
  display: grid;
  place-items: center;
  transition: transform .35s cubic-bezier(.3, 1.4, .5, 1);
  transform-origin: 50% 85%;
}
.balloon-body svg { width: 100%; height: 100%; overflow: visible; }
.balloon-body.floating { animation: balloonFloat 2.6s ease-in-out infinite alternate; }
.balloon-body.pop { animation: burstOut .45s forwards; }

@keyframes balloonFloat {
  from { translate: 0 0; }
  to { translate: 0 -9px; }
}
@keyframes burstOut {
  0% { transform: scale(1.18); }
  100% { transform: scale(0); opacity: 0; }
}

/* Осколки при разрыве */
.shards { position: absolute; inset: 0; pointer-events: none; display: grid; place-items: center; }
.shards i {
  position: absolute;
  width: 11px; height: 14px;
  background: #ff5d72;
  border-radius: 60% 40% 50% 50%;
  animation: shardFly .7s ease-out forwards;
}

@keyframes shardFly {
  from { opacity: 1; transform: translate(0, 0) rotate(0); }
  to { opacity: 0; transform: translate(var(--sx), var(--sy)) rotate(var(--sr)); }
}

/* Шкала накачки */
.pump-bar {
  height: 8px;
  border-radius: 99px;
  background: rgba(255, 255, 255, .09);
  overflow: hidden;
  margin: 4px 20px 0;
}
.pump-fill {
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--mint), var(--gold));
  transition: width .35s cubic-bezier(.2, .9, .3, 1);
}

/* ============================================================
   FACE ID
   ============================================================ */

.face-stage { text-align: center; }
.face-frame {
  width: 200px;
  height: 200px;
  margin: 0 auto 14px;
  border-radius: 50%;
  overflow: hidden;
  position: relative;
  background: var(--panel-2);
  border: 2px solid var(--line);
  display: grid;
  place-items: center;
}
.face-frame.scanning { border-color: var(--mint); box-shadow: var(--glow-mint); }
.face-frame.ok { border-color: var(--mint); }
.face-frame.bad { border-color: var(--ember); }
.face-frame video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.face-frame .placeholder { font-size: 46px; opacity: .3; }
/* Снимок документа */
.shot {
  border: 1px dashed var(--line);
  border-radius: var(--r);
  background: var(--panel-2);
  min-height: 150px;
  display: grid;
  place-items: center;
  overflow: hidden;
  margin-bottom: 10px;
}
.shot.filled { border-style: solid; border-color: var(--mint-dim); }
.shot-preview { width: 100%; max-height: 220px; object-fit: contain; display: block; }
.shot-empty { font-size: 40px; opacity: .3; }

.face-scan {
  position: absolute;
  left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--mint), transparent);
  animation: scanline 2s linear infinite;
}

@keyframes scanline { 0% { top: 8%; } 50% { top: 92%; } 100% { top: 8%; } }

/* ============================================================
   ПРОФИЛЬ, ЕЖЕДНЕВКА, РЕФЕРАЛКА
   ============================================================ */

.daily-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }

@media (min-width: 620px) { .daily-grid { grid-template-columns: repeat(7, 1fr); } }

.daily-day {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 12px 6px;
  text-align: center;
  transition: all .2s;
}
.daily-day .d {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 6px;
}
.daily-day .p { font-size: 17px; font-weight: 700; font-family: var(--mono); }
.daily-day.claimed { opacity: .45; }
.daily-day.claimed .p { color: var(--mint); }
.daily-day.today { border-color: var(--gold); background: rgba(255, 194, 75, .09); }
.daily-day.today .p { color: var(--gold); }

.ref-bar { height: 6px; background: var(--panel-3); border-radius: 99px; overflow: hidden; margin: 14px 0 10px; }
.ref-fill { height: 100%; background: linear-gradient(90deg, var(--mint-dim), var(--mint)); border-radius: 99px; transition: width .5s cubic-bezier(.2, .9, .3, 1); }

.tier {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 9px;
  background: var(--panel-2);
  margin-bottom: 6px;
  font-size: 13px;
  border: 1px solid transparent;
}
.tier.now { border-color: var(--mint-dim); background: rgba(0, 229, 160, .08); }
.tier.done { opacity: .55; }
.tier strong { font-family: var(--mono); }

.big-stat { text-align: center; padding: 14px 0; }
.big-stat .v { font-family: var(--mono); font-size: 40px; font-weight: 700; line-height: 1; }
.big-stat .k { font-size: 12px; color: var(--ink-3); margin-top: 6px; }

.copy-box {
  display: flex;
  gap: 8px;
  align-items: center;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 11px 12px;
  font-family: var(--mono);
  font-size: 12px;
  word-break: break-all;
  color: var(--ink-2);
}
.copy-box button {
  margin-left: auto;
  flex-shrink: 0;
  background: var(--panel-3);
  border: 0;
  color: var(--ink);
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
}
.copy-box button:hover { background: var(--mint); color: #04120c; }

.tx { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
.tx:last-child { border-bottom: 0; }
.tx-ico {
  width: 34px; height: 34px;
  border-radius: 10px;
  display: grid; place-items: center;
  background: var(--panel-3);
  font-size: 15px;
  flex-shrink: 0;
}
.tx-main { min-width: 0; flex: 1; }
.tx-title { font-size: 13.5px; font-weight: 600; }
.tx-sub { font-size: 11px; color: var(--ink-3); margin-top: 2px; font-family: var(--mono); }
.tx-amt { font-family: var(--mono); font-weight: 700; font-size: 14px; white-space: nowrap; }

.player {
  background: linear-gradient(160deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 24px 20px;
  text-align: center;
}
.disc {
  width: 130px; height: 130px;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, var(--panel-3), var(--panel-2), var(--panel-3));
  display: grid; place-items: center;
  font-size: 42px;
  border: 6px solid var(--panel-3);
}
.disc.playing { animation: spin 6s linear infinite; }

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

.track-name { font-size: 17px; font-weight: 700; }
.track-artist { font-size: 13px; color: var(--ink-3); margin-top: 3px; }
.progress { height: 4px; background: var(--panel-3); border-radius: 99px; margin: 18px 0 14px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--mint); border-radius: 99px; width: 0; transition: width .15s linear; }
.player-btns { display: flex; align-items: center; justify-content: center; gap: 18px; margin-bottom: 16px; }
.pbtn {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--panel-3);
  border: 0;
  color: var(--ink);
  font-size: 15px;
  cursor: pointer;
  display: grid; place-items: center;
}
.pbtn.main { width: 58px; height: 58px; background: var(--mint); color: #04120c; font-size: 19px; }
.pbtn:hover { filter: brightness(1.12); }

.chart { display: flex; align-items: flex-end; gap: 2px; height: 110px; margin: 16px 0; }
.candle { flex: 1; border-radius: 2px 2px 0 0; min-width: 2px; }
.candle.u { background: rgba(0, 229, 160, .55); }
.candle.d { background: rgba(255, 77, 94, .45); }

/* ============================================================
   ПОЛНОЭКРАННЫЕ РАЗДЕЛЫ
   Игра, график пары и прочие тяжёлые экраны открываются страницей
   на весь экран, а не окошком поверх сайта.
   ============================================================ */

.overlay.full {
  padding: 0;
  align-items: stretch;
  justify-content: stretch;
  background: var(--void);
  backdrop-filter: none;
}

.overlay.full .modal {
  width: 100%;
  max-width: none;
  height: 100dvh;
  max-height: none;
  border: 0;
  border-radius: 0;
  padding: 0;
  animation: viewIn .28s cubic-bezier(.22, .8, .3, 1);
  display: flex;
  flex-direction: column;
}

@keyframes viewIn {
  from { opacity: 0; transform: translateY(18px) scale(.99); }
  to { opacity: 1; transform: none; }
}

/* Полосу-шапку и содержимое держим в читаемой колонке даже на широком мониторе */
.view-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(16, 22, 32, .92);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 5;
  flex-shrink: 0;
}
.view-title {
  font-size: 17px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.view-back {
  width: 38px; height: 38px;
  flex-shrink: 0;
  border-radius: 11px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 19px;
  line-height: 1;
  cursor: pointer;
  display: grid; place-items: center;
  transition: background .16s, transform .12s;
}
.view-back:hover { background: var(--panel-3); }
.view-back:active { transform: scale(.94); }

.view-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0;
}

.view-inner {
  max-width: 560px;
  margin: 0 auto;
  padding: 0 0 32px;
  min-width: 0;
}

/* Игровой экран внутри полноэкранного вида.
   Высоту сцены задаёт содержимое, а не жёсткие vh — иначе на телефоне
   мелкий результат оставлял пол-экрана чёрной пустоты и всё вылезало за экран. */
.overlay.full .game-modal { max-width: none; }
.overlay.full .g-stage {
  min-height: 0;
  padding: 16px 14px;
}
/* Содержимое экрана прижато кверху, а не растянуто по центру пустой сцены */
.overlay.full .view-inner {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: 8px;
}

@media (min-width: 1000px) {
  .overlay.full .g-stage { min-height: 260px; }
  .view-inner { max-width: 640px; }
}

/* Краш-играм нужна широкая сцена — их колонка шире остальных экранов */
@media (min-width: 1100px) {
  .crash-view .view-inner { max-width: 1040px; }
}

/* ============================================================
   УЗКИЕ ЭКРАНЫ
   Главное правило: ни один блок внутри окна не должен диктовать
   ширину больше экрана, поэтому всем флекс-детям сбрасываем min-width.
   ============================================================ */

.g-fields, .g-stats, .bet-quick, .btn-row, .choice-row, .g-controls, .g-stage { min-width: 0; }
.g-field, .g-stat, .btn, .choice { min-width: 0; }
.bet-quick button { min-width: 0; flex: 1 1 0; }
.g-fields { flex-wrap: wrap; }
.g-stage, .g-controls { max-width: 100%; }
.idle-art p, .note, .hint, .result-sub { overflow-wrap: anywhere; }

@media (max-width: 560px) {
  body { font-size: 14.5px; }

  /* Уплотнение главной: меньше воздуха между блоками — меньше прокрутки */
  .shell { padding: 0 12px 84px; }
  .section-head { margin: 16px 0 8px; }
  .quick { gap: 6px; margin-top: 12px; }
  .quick-item { padding: 10px 4px; gap: 5px; font-size: 10px; }
  .quick-ico { font-size: 17px; }

  .promo { margin-top: 12px; padding: 14px; gap: 10px; }
  .promo h3 { font-size: 16px; margin-bottom: 5px; }
  .promo p { font-size: 12px; line-height: 1.4; }
  .promo-marks { margin-top: 8px; gap: 4px; }
  .promo-art { font-size: 38px; }

  .market-tabs, .sub-tabs { margin: 12px 0 8px; }
  .leader { padding: 8px 10px; gap: 10px; }
  .leader-sub { font-size: 10.5px; }
  .mkt-row, .mkt-head { padding: 9px 10px; }
  .card { padding: 13px; margin-bottom: 10px; }

  /* Верхняя панель: аккуратно и без наездов на цифры баланса */
  .topbar-inner { padding: 9px 12px; gap: 10px; align-items: center; }
  .topbar-inner > div:first-child { flex: 1 1 auto; min-width: 0; }
  .uid-line { font-size: 9px; }
  .balance-label { font-size: 10px; margin-top: 1px; }
  .balance-value { font-size: 19px; white-space: nowrap; }
  .balance-value small { font-size: 11px; margin-left: 3px; }

  .top-actions { flex: 0 0 auto; gap: 6px; }
  #langBtn { display: none; }                       /* язык — в шестерёнке настроек */
  .top-actions .icon-btn:last-child { display: none; } /* рефералы есть на главной как «Пригласить» */
  .deposit-btn { padding: 9px 13px; font-size: 13px; white-space: nowrap; }
  .icon-btn { width: 36px; height: 36px; font-size: 15px; }

  .modal { padding: 16px; }
  .game-modal { padding: 0; max-width: 100%; }

  .g-head { padding: 13px 14px; gap: 8px; }
  .g-title { font-size: 15px; }
  .g-fair { padding: 4px 7px; font-size: 9px; }
  .g-stage { padding: 14px 12px; min-height: 160px; }
  .g-controls { padding: 12px 12px 16px; }

  .g-stat { padding: 8px 6px; }
  .g-stat .v { font-size: 13.5px; }
  .g-stat .k { font-size: 8.5px; letter-spacing: .08em; }

  .choice { min-width: 72px; font-size: 12.5px; padding: 10px 6px; }
  .choice small { font-size: 10px; }

  .mines-grid { gap: 5px; }
  .m-cell { font-size: 18px; border-radius: 8px; }
  .reels { gap: 3px; padding: 6px; }
  .reel { gap: 3px; }
  .pcard { width: 48px; height: 70px; font-size: 12px; }
  .pcard .mid { font-size: 17px; }
  .tower-tile { width: 46px; height: 30px; }
  .step-dot { width: 27px; height: 27px; font-size: 10px; }
  .step-line { width: 8px; }
  .crash-mult { font-size: 38px; }
  .crash-canvas { height: 180px; }
  .result-main { font-size: 32px; }
  .result-main.sm { font-size: 21px; }

  .quick { grid-template-columns: repeat(4, 1fr); gap: 6px; }
  .quick-item { padding: 12px 4px; font-size: 10.5px; }
  .games-grid { grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 8px; }
  .promo { padding: 18px; }
  .promo-art { font-size: 40px; }
  .balance-value { font-size: 23px; }
  .topbar-inner { padding: 10px 12px; gap: 10px; }
  .icon-btn { width: 36px; height: 36px; font-size: 14px; }
  .deposit-btn { padding: 9px 13px; font-size: 13px; }
  .shell { padding: 0 12px 96px; }
}

@media (max-width: 380px) {
  .top-actions { gap: 5px; }
  .icon-btn { width: 33px; height: 33px; }
  .games-grid { grid-template-columns: repeat(2, 1fr); }
  .choice { min-width: 60px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}
