/* ── Reset ── */
*, *::before, *::after {
  margin: 0; padding: 0; box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

/* ── Tokens ── */
:root {
  --bg:        #080b1a;
  --surface:   #0f1226;
  --card:      #141830;
  --card2:     #1a1e3a;
  --border:    rgba(255,215,0,.18);
  --gold:      #ffd700;
  --gold-l:    #ffe566;
  --gold-dim:  rgba(255,215,0,.4);
  --red:       #e74c3c;
  --green:     #27ae60;
  --text:      #e8eaf6;
  --muted:     #6c7099;
  --win-c:     #2ecc71;
  --lose-c:    #e74c3c;
  --r:         16px;
  --glow:      0 0 28px rgba(255,215,0,.35);
}

/* ── Base ── */
html, body { height: 100%; }
body {
  font-family: 'Montserrat', -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  min-height: 100vh;
}
body.profile-open {
  overflow: hidden;
}

#app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(88,28,220,.25) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 80% 110%, rgba(255,215,0,.06) 0%, transparent 60%),
    var(--bg);
}

/* ── Splash / экран загрузки ── */
.splash {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

.splash.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.splash-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 100% 80% at 50% 20%, rgba(255,215,0,.12) 0%, transparent 50%),
    radial-gradient(ellipse 80% 60% at 50% 80%, rgba(88,28,220,.2) 0%, transparent 50%),
    linear-gradient(180deg, #0a0c1a 0%, #080b1a 100%);
}

.splash-content {
  position: relative;
  text-align: center;
  padding: 24px;
}

.splash-icon {
  font-size: 56px;
  margin-bottom: 16px;
  animation: splashIconPulse 1.2s ease-in-out infinite;
}

.splash-title {
  font-size: clamp(22px, 6vw, 28px);
  font-weight: 900;
  letter-spacing: 2px;
  color: var(--gold);
  text-shadow: 0 0 30px rgba(255,215,0,.6), 0 0 60px rgba(255,215,0,.25);
  margin-bottom: 28px;
  animation: splashTitleShine 2.5s ease-in-out infinite;
}

.splash-loader {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.splash-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 12px rgba(255,215,0,.8);
  animation: splashDotBounce 0.8s ease-in-out infinite;
}

.splash-dot:nth-child(1) { animation-delay: 0s; }
.splash-dot:nth-child(2) { animation-delay: 0.15s; }
.splash-dot:nth-child(3) { animation-delay: 0.3s; }

@keyframes splashIconPulse {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 0 12px rgba(255,215,0,.5)); }
  50%      { transform: scale(1.08); filter: drop-shadow(0 0 20px rgba(255,215,0,.8)); }
}

@keyframes splashTitleShine {
  0%, 100% { opacity: 1; text-shadow: 0 0 30px rgba(255,215,0,.6), 0 0 60px rgba(255,215,0,.25); }
  50%      { opacity: 0.92; text-shadow: 0 0 40px rgba(255,215,0,.9), 0 0 80px rgba(255,215,0,.4); }
}

@keyframes splashDotBounce {
  0%, 100% { transform: translateY(0); opacity: 0.8; }
  50%      { transform: translateY(-10px); opacity: 1; }
}

/* ── Тюрьма (полный экран, красные тона) ── */
.jail-overlay {
  position: fixed;
  inset: 0;
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}
.jail-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.jail-overlay-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 100% 80% at 50% 20%, rgba(180, 40, 40, .25) 0%, transparent 50%),
    radial-gradient(ellipse 80% 60% at 50% 80%, rgba(120, 20, 20, .3) 0%, transparent 50%),
    linear-gradient(180deg, #1a0a0a 0%, #0d0505 100%);
}
.jail-overlay-content {
  position: relative;
  text-align: center;
  padding: 28px 24px;
  max-width: 340px;
}
.jail-overlay-icon {
  font-size: 64px;
  margin-bottom: 16px;
  filter: drop-shadow(0 0 20px rgba(200, 60, 60, .6));
  animation: jailIconPulse 2s ease-in-out infinite;
}
@keyframes jailIconPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%      { transform: scale(1.05); opacity: 0.9; }
}
.jail-overlay-title {
  font-size: clamp(24px, 7vw, 30px);
  font-weight: 900;
  color: #e8a0a0;
  text-shadow: 0 0 24px rgba(220, 80, 80, .6);
  margin-bottom: 12px;
}
.jail-overlay-desc {
  font-size: 14px;
  color: rgba(240, 200, 200, .85);
  line-height: 1.45;
  margin-bottom: 24px;
}
.jail-overlay-timer {
  font-size: 28px;
  font-weight: 800;
  color: #ff6b6b;
  text-shadow: 0 0 16px rgba(255, 100, 100, .5);
  margin-bottom: 8px;
  font-variant-numeric: tabular-nums;
}
.jail-overlay-cost {
  font-size: 13px;
  color: rgba(220, 180, 180, .9);
  margin-bottom: 24px;
}
.jail-overlay-btn {
  width: 100%;
  padding: 16px 24px;
  font-size: 16px;
  font-weight: 800;
  font-family: inherit;
  color: #1a0a0a;
  background: linear-gradient(180deg, #e86060 0%, #c04040 100%);
  border: none;
  border-radius: var(--r);
  box-shadow: 0 0 24px rgba(200, 60, 60, .5), inset 0 1px 0 rgba(255,255,255,.2);
  cursor: pointer;
  transition: transform .2s, box-shadow .2s;
}
.jail-overlay-btn:hover {
  transform: scale(1.02);
  box-shadow: 0 0 28px rgba(220, 80, 80, .6), inset 0 1px 0 rgba(255,255,255,.25);
}
.jail-overlay-btn:active { transform: scale(0.98); }
.jail-overlay-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* ── Header ── */
.header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: linear-gradient(180deg, rgba(20,24,56,.95) 0%, rgba(14,17,40,.85) 100%);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(20px);
  position: sticky; top: 0; z-index: 50;
}

.avatar-wrap {
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  border-radius: 50%;
  flex-shrink: 0;
  display: block;
}

.avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #5e35b1, #9c27b0);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 800; color: #fff; flex-shrink: 0;
  border: 2px solid var(--gold-dim);
  box-shadow: 0 0 16px rgba(94,53,177,.5);
  overflow: hidden;
  transition: transform 0.2s ease;
}
.avatar-wrap:hover .avatar { transform: scale(1.05); }
.avatar-wrap:active .avatar { transform: scale(0.98); }

.avatar.has-photo {
  background: transparent;
  padding: 0;
}

.avatar .avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Обёртка аватара с рамкой достижения */
.avatar-with-frame {
  position: relative;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 50%;
}
.avatar-with-frame .avatar {
  width: 100%;
  height: 100%;
}
.avatar-frame {
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.2s ease;
  display: none;
  border: 4px solid transparent;
  box-sizing: border-box;
}
/* Рамка как градиентное кольцо (рисуем фоном + вырез по центру) */
.avatar-frame::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  padding: 4px;
  background: var(--frame-fill);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  box-shadow: var(--frame-glow);
}
.avatar-frame.frame-bronze {
  --frame-fill: linear-gradient(145deg, #e8c878 0%, #c9a057 35%, #8b6914 70%, #c9a057 100%);
  --frame-glow: 0 0 14px rgba(201,160,87,.6), inset 0 1px 0 rgba(255,255,255,.25);
}
.avatar-frame.frame-silver {
  --frame-fill: linear-gradient(145deg, #f0f0f0 0%, #c0c0c0 40%, #808080 70%, #c0c0c0 100%);
  --frame-glow: 0 0 16px rgba(192,192,192,.55), inset 0 1px 0 rgba(255,255,255,.4);
}
.avatar-frame.frame-gold {
  --frame-fill: linear-gradient(145deg, #ffe55c 0%, #ffd700 30%, #b8860b 65%, #ffd700 100%);
  --frame-glow: 0 0 20px rgba(255,215,0,.6), inset 0 1px 0 rgba(255,255,255,.35);
}
.avatar-frame.frame-diamond {
  --frame-fill: linear-gradient(145deg, #e0f7ff 0%, #b9f2ff 30%, #5eb8e8 65%, #b9f2ff 100%);
  --frame-glow: 0 0 22px rgba(185,242,255,.6), inset 0 1px 0 rgba(255,255,255,.4);
}
.avatar-frame.frame-bronze,
.avatar-frame.frame-silver,
.avatar-frame.frame-gold,
.avatar-frame.frame-diamond {
  display: block;
}

/* Блик для золотой и алмазной рамок */
.avatar-frame.frame-gold::after,
.avatar-frame.frame-diamond::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  padding: 4px;
  background: linear-gradient(105deg, transparent 0%, transparent 35%, rgba(255,255,255,.5) 50%, transparent 65%, transparent 100%);
  background-size: 120% 100%;
  animation: frameShimmer 2.8s ease-in-out infinite;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}
.avatar-frame.frame-diamond::after {
  background: linear-gradient(105deg, transparent 0%, transparent 35%, rgba(255,255,255,.6) 50%, transparent 65%, transparent 100%);
  animation-duration: 2.4s;
}

@keyframes frameShimmer {
  0%, 100% { background-position: 120% 0; }
  50% { background-position: -20% 0; }
}

.user-info { flex: 1; min-width: 0; }

.username {
  font-size: 14px; font-weight: 700;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.balance-wrap { display: flex; align-items: center; gap: 4px; margin-top: 2px; }
.balance-wrap.header-balances {
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}
.balance-wrap .balance-item { display: flex; align-items: center; gap: 4px; }

.balance-icon { font-size: 13px; }

.balance {
  font-size: 20px; font-weight: 900;
  color: var(--gold);
  text-shadow: 0 0 16px rgba(255,215,0,.55);
  letter-spacing: .5px;
}

.balance.pop { animation: balancePop .55s ease; }

.balance-label { font-size: 11px; color: var(--muted); }

.header-logo { font-size: 26px; flex-shrink: 0; filter: drop-shadow(0 0 8px rgba(255,215,0,.5)); }

/* ── Tabs (горизонтальная прокрутка) ── */
.tabs {
  display: flex;
  gap: 6px;
  padding: 10px 14px 0;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.tabs::-webkit-scrollbar {
  display: none;
}
.tab {
  flex: 0 0 auto;
  min-width: 72px;
  padding: 10px 8px;
  border: none; border-radius: 12px 12px 0 0;
  background: none;
  color: var(--muted);
  font-family: inherit; font-size: 12px; font-weight: 700;
  cursor: pointer; transition: all .25s;
  white-space: nowrap;
}

.tab.active {
  background: var(--card);
  color: var(--gold);
  box-shadow: inset 0 -2px 0 var(--gold), var(--glow);
}

.tab:hover:not(.active) { color: var(--text); background: rgba(255,255,255,.04); }

/* ── Game area (свайп между разделами) ── */
.game-area {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  position: relative;
}
.game-area-swipe {
  display: flex;
  width: 700%;
  height: 100%;
  transition: transform 0.3s ease-out;
  will-change: transform;
}
.game-area-swipe .game {
  flex: 0 0 14.285714%;
  width: 14.285714%;
  min-width: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 18px 14px 30px;
  box-sizing: border-box;
}
.game.hidden { display: none; }
.game { min-width: 0; }

/* ── Card ── */
.game-card {
  min-width: 0;
  max-width: 100%;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 22px 18px 24px;
  box-shadow: 0 8px 40px rgba(0,0,0,.45);
  animation: cardIn .3s ease;
}

.game-title {
  font-size: 19px; font-weight: 900;
  text-align: center;
  color: var(--gold);
  text-shadow: 0 0 20px rgba(255,215,0,.5);
  letter-spacing: 1px;
  margin-bottom: 22px;
}

/* ── Банк ── */
.bank-card .bank-summary {
  margin-bottom: 20px;
  padding: 16px 18px;
  background: rgba(0,0,0,.35);
  border: 1px solid rgba(255,215,0,.2);
  border-radius: var(--r);
}
.bank-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  font-size: 14px;
}
.bank-row:not(:last-child) { border-bottom: 1px solid rgba(255,255,255,.08); }
.bank-label { color: var(--muted); font-weight: 700; min-width: 90px; }
.bank-value { font-weight: 900; color: var(--gold); }
.bank-currency { color: var(--muted); font-size: 12px; }
.bank-amount-row {
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.bank-amount-label { font-size: 14px; font-weight: 700; color: var(--muted); }
.bank-amount-input {
  flex: 1;
  max-width: 160px;
  padding: 10px 14px;
  border: 2px solid rgba(255,215,0,.3);
  border-radius: 10px;
  background: rgba(0,0,0,.4);
  color: var(--text);
  font-size: 16px;
  font-weight: 800;
  -moz-appearance: textfield;
}
.bank-amount-input::-webkit-outer-spin-button,
.bank-amount-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.bank-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.bank-btn {
  padding: 12px 10px;
  border: 2px solid rgba(255,215,0,.35);
  border-radius: 12px;
  background: rgba(255,215,0,.08);
  color: var(--gold);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background .2s, border-color .2s;
}
.bank-btn:hover { background: rgba(255,215,0,.15); border-color: var(--gold-dim); }
.bank-btn:active { transform: scale(0.98); }
.bank-btn-to-savings, .bank-btn-from-savings { border-color: rgba(46,204,113,.4); background: rgba(46,204,113,.08); color: var(--win-c); }
.bank-btn-to-savings:hover, .bank-btn-from-savings:hover { background: rgba(46,204,113,.15); }

/* ── Вклады (срок, отображение) ── */
.bank-deposits-block {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,.08);
}
.bank-deposits-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--gold);
  margin-bottom: 6px;
}
.bank-deposits-hint {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 14px;
}
.bank-deposit-active.hidden,
.bank-deposit-open.hidden { display: none; }
.bank-deposit-card {
  padding: 12px 14px;
  background: rgba(0,0,0,.3);
  border: 1px solid rgba(46,204,113,.25);
  border-radius: var(--r);
  margin-bottom: 12px;
}
.bank-deposit-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  font-size: 13px;
}
.bank-deposit-label { color: var(--muted); min-width: 120px; }
.bank-deposit-value { font-weight: 800; color: var(--gold); }
.bank-deposit-term-row {
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.bank-deposit-term-btns {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.bank-deposit-term-btn {
  padding: 10px 14px;
  border: 2px solid rgba(255,215,0,.25);
  border-radius: 10px;
  background: rgba(255,215,0,.06);
  color: var(--muted);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all .2s;
}
.bank-deposit-term-btn:hover { color: var(--text); border-color: rgba(255,215,0,.4); }
.bank-deposit-term-btn.active {
  border-color: var(--gold);
  background: rgba(255,215,0,.15);
  color: var(--gold);
}

.chips-rates { font-size: 12px; color: var(--muted); margin-bottom: 14px; text-align: center; }
.chips-actions { grid-template-columns: 1fr; }

/* ── Экран-шлюз: купить фишки при 0 ── */
.chips-gate {
  position: fixed;
  inset: 0;
  z-index: 3000;
  background: linear-gradient(180deg, #0a0c1a 0%, #060814 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow-y: auto;
}
.chips-gate.hidden { display: none; }
.chips-gate-content {
  width: 100%;
  max-width: 360px;
  text-align: center;
}
.chips-gate-title {
  font-size: 22px;
  font-weight: 900;
  color: var(--gold);
  margin-bottom: 12px;
  text-shadow: 0 0 24px rgba(255,215,0,.4);
}
.chips-gate-desc {
  font-size: 15px;
  color: var(--text);
  margin-bottom: 8px;
}
.chips-gate-rate {
  font-size: 14px;
  color: var(--gold);
  font-weight: 700;
  margin-bottom: 16px;
}
.chips-gate-balance {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 20px;
}
.chips-gate-balance span { font-weight: 800; color: var(--gold); }
.chips-gate-amount-row {
  margin-bottom: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.chips-gate-amount-row label { font-size: 13px; color: var(--muted); }
.chips-gate-stepper {
  display: flex;
  align-items: center;
  gap: 0;
  border: 2px solid rgba(255,215,0,.35);
  border-radius: 12px;
  background: rgba(0,0,0,.4);
  overflow: hidden;
}
.chips-gate-adj {
  width: 48px;
  height: 48px;
  border: none;
  background: rgba(255,215,0,.12);
  color: var(--gold);
  font-size: 24px;
  font-weight: 800;
  cursor: pointer;
  line-height: 1;
  transition: background .2s;
  flex-shrink: 0;
}
.chips-gate-adj:hover { background: rgba(255,215,0,.22); }
.chips-gate-adj:active { transform: scale(0.96); }
.chips-gate-input {
  width: 80px;
  padding: 12px 8px;
  border: none;
  border-left: 1px solid rgba(255,215,0,.2);
  border-right: 1px solid rgba(255,215,0,.2);
  background: transparent;
  color: var(--text);
  font-size: 18px;
  font-weight: 800;
  text-align: center;
  -moz-appearance: textfield;
}
.chips-gate-input::-webkit-outer-spin-button,
.chips-gate-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.chips-gate-cost {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 20px;
}
.chips-gate-buy, .chips-gate-continue {
  display: block;
  width: 100%;
  max-width: 280px;
  margin: 0 auto 12px;
  padding: 16px 24px;
  border: 2px solid var(--gold);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255,215,0,.2) 0%, rgba(255,215,0,.08) 100%);
  color: var(--gold);
  font-family: inherit;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  transition: background .2s, transform .1s;
}
.chips-gate-buy:hover, .chips-gate-continue:hover {
  background: rgba(255,215,0,.25);
}
.chips-gate-buy.hidden, .chips-gate-continue.hidden { display: none; }
.chips-gate-hint {
  font-size: 13px;
  color: var(--muted);
  margin-top: 8px;
}

/* ══════════════ SLOTS: 5 барабанов ══════════════ */
.slot-machine { position: relative; margin-bottom: 18px; }

.slot-glow {
  position: absolute; inset: -4px;
  border-radius: 16px;
  background: transparent;
  box-shadow: 0 0 0 0 rgba(255,215,0,0);
  transition: box-shadow .4s;
  pointer-events: none;
}
.slot-machine.winning .slot-glow { box-shadow: 0 0 40px 6px rgba(255,215,0,.45); }

.slot-frame.slot-reels {
  display: flex;
  justify-content: center;
  gap: 6px;
  background: linear-gradient(180deg, #0a0c1a 0%, #060818 100%);
  border: 3px solid rgba(255,215,0,.35);
  border-radius: 14px;
  padding: 14px 12px;
  box-shadow: inset 0 8px 32px rgba(0,0,0,.7), 0 0 0 1px rgba(255,255,255,.04);
  position: relative;
  overflow: hidden;
}

/* Один барабан: вертикальная полоса с «окном» из 3 ячеек */
.reel-drum {
  display: flex;
  flex-direction: column;
  width: 52px;
  background: linear-gradient(90deg, rgba(0,0,0,.5) 0%, #0c0e20 50%, rgba(0,0,0,.5) 100%);
  border: 2px solid rgba(255,215,0,.25);
  border-radius: 10px;
  box-shadow: inset 0 0 20px rgba(0,0,0,.8), 0 2px 8px rgba(0,0,0,.4);
  overflow: hidden;
}

.reel-drum .reel-cell {
  width: 100%;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  background: transparent;
  border-bottom: 1px solid rgba(255,215,0,.12);
  will-change: transform;
  transition: filter .2s;
  flex-shrink: 0;
}
.reel-drum .reel-cell:last-child { border-bottom: none; }

.reel-drum .reel-cell.spinning { animation: reelBlur .12s linear infinite; }
.reel-drum .reel-cell.land { animation: reelLand .45s cubic-bezier(.36,.07,.19,.97); }
.reel-drum .reel-cell.win-cell { box-shadow: inset 0 0 16px rgba(46,204,113,.4); background: rgba(46,204,113,.12); }

/* Кнопка «Таблица выплат» */
.payout-btn {
  width: 100%;
  margin-bottom: 18px;
  padding: 12px 16px;
  border: 2px solid rgba(255,215,0,.25);
  border-radius: 12px;
  background: rgba(255,215,0,.06);
  color: var(--gold-dim);
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all .25s;
}
.payout-btn:hover {
  background: rgba(255,215,0,.12);
  color: var(--gold);
  border-color: var(--gold-dim);
}

/* Модалка выплат */
.payout-overlay {
  position: fixed;
  inset: 0;
  z-index: 250;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,.75);
  backdrop-filter: blur(8px);
  animation: fadeIn .25s ease;
  padding: 20px;
}
.payout-overlay.hidden { display: none; }

.payout-modal {
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: var(--r);
  padding: 20px 18px 18px;
  max-width: 340px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  animation: popIn .3s ease;
}

.payout-modal-title {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--gold);
  text-align: center;
  margin-bottom: 14px;
}

.payout-modal-table .pm-section {
  font-size: 12px;
  color: var(--text);
  margin-bottom: 12px;
  line-height: 1.35;
}

.payout-modal-table .pm-subtitle {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: var(--gold);
  margin: 10px 0 6px;
}

.payout-modal-table .pm-subtitle:first-child { margin-top: 0; }

.payout-modal-table .pm-pattern {
  font-size: 12px;
  color: var(--muted);
  padding: 3px 0;
  padding-left: 0;
}

.payout-modal-table .pm-pattern .pm-name {
  color: var(--gold);
  font-weight: 700;
  margin-right: 6px;
}

.payout-modal-table .pm-footer {
  margin-top: 10px;
  font-size: 11px;
  color: var(--muted);
}

.payout-modal-table {
  margin-bottom: 12px;
  font-size: 13px;
  color: var(--text);
}

.payout-modal-table .pm-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.payout-modal-table .pm-row:last-child { border-bottom: none; }
.payout-modal-table .pm-sym { font-size: 16px; }
.payout-modal-table .pm-mult { color: var(--gold); font-weight: 800; }

.payout-modal-note {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 14px;
  line-height: 1.4;
}

.payout-modal-close {
  width: 100%;
  padding: 12px;
  border: 2px solid var(--border);
  border-radius: 10px;
  background: rgba(255,215,0,.1);
  color: var(--gold);
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all .2s;
}
.payout-modal-close:hover { background: rgba(255,215,0,.2); }

/* ── Панель профиля (разворот по клику на аватар) ── */
.profile-panel {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 0;
  z-index: 2000;
  overflow: hidden;
  transition: height 0.45s cubic-bezier(0.32, 0.72, 0, 1), opacity 0.4s ease;
  opacity: 0;
  pointer-events: none;
}

.profile-panel.open {
  height: 100vh;
  height: 100dvh;
  opacity: 1;
  pointer-events: auto;
  overflow-y: auto;
  overflow-x: hidden;
}

/* Обёртка фона: в потоке документа, растёт по контенту — без absolute, чтобы не ломать высоту при скролле */
.profile-panel-bg {
  min-height: 100%;
  /* Непрозрачный фон, чтобы контент игр не просвечивал сквозь панель */
  background:
    radial-gradient(ellipse 120% 70% at 50% -5%, rgba(255,215,0,.06) 0%, #0a0c1a 50%),
    radial-gradient(ellipse 90% 60% at 50% 105%, rgba(88,28,220,.1) 0%, #080b1a 50%),
    linear-gradient(180deg, #0a0c1a 0%, #090b1c 25%, #080b1a 50%, #080b1a 75%, #060818 100%);
}

.profile-panel-back {
  position: absolute;
  top: 14px;
  left: 16px;
  z-index: 10;
  padding: 10px 16px;
  border: 2px solid rgba(255,215,0,.3);
  border-radius: 12px;
  background: rgba(255,215,0,.08);
  color: var(--gold);
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s, background 0.2s, border-color 0.2s;
}
.profile-panel-back:hover {
  background: rgba(255,215,0,.15);
  border-color: var(--gold-dim);
}
.profile-panel-back:active { transform: scale(0.97); }

.profile-panel-content {
  position: relative;
  padding: 56px 20px 32px 20px;
  padding-right: 24px;
  min-height: 100%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  -webkit-overflow-scrolling: touch;
}

.profile-panel-hero {
  flex-shrink: 0;
  text-align: center;
  padding: 24px 0 32px;
  width: 100%;
}

.profile-panel-avatar-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
}

/* В профиле обёртка с рамкой — крупный размер */
.avatar-with-frame.profile-avatar-wrap {
  width: 120px;
  height: 120px;
}
.avatar-with-frame.profile-avatar-wrap .avatar-frame {
  inset: -6px;
}
.avatar-with-frame.profile-avatar-wrap .avatar-frame::before {
  padding: 5px;
}
.avatar-with-frame.profile-avatar-wrap .avatar-frame.frame-bronze::before { box-shadow: 0 0 24px rgba(201,160,87,.6), inset 0 1px 0 rgba(255,255,255,.2); }
.avatar-with-frame.profile-avatar-wrap .avatar-frame.frame-silver::before { box-shadow: 0 0 28px rgba(192,192,192,.55), inset 0 1px 0 rgba(255,255,255,.35); }
.avatar-with-frame.profile-avatar-wrap .avatar-frame.frame-gold::before { box-shadow: 0 0 32px rgba(255,215,0,.6), inset 0 1px 0 rgba(255,255,255,.4); }
.avatar-with-frame.profile-avatar-wrap .avatar-frame.frame-diamond::before { box-shadow: 0 0 36px rgba(185,242,255,.65), inset 0 1px 0 rgba(255,255,255,.45); }

.profile-panel-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: linear-gradient(135deg, #5e35b1, #9c27b0);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  font-weight: 800;
  color: #fff;
  border: 4px solid var(--gold-dim);
  box-shadow: 0 0 40px rgba(94,53,177,.5), 0 0 0 1px rgba(255,255,255,.05);
  overflow: hidden;
}
.profile-panel-avatar.has-photo { background: transparent; padding: 0; }
.profile-panel-avatar .avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.profile-achievements-btn {
  width: 100%;
  max-width: 340px;
  margin-top: 12px;
  padding: 14px 20px;
  border: 2px solid rgba(255,215,0,.35);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255,215,0,.12) 0%, rgba(255,215,0,.05) 100%);
  color: var(--gold);
  font-family: inherit;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.25s ease;
}
.profile-achievements-btn:hover {
  background: rgba(255,215,0,.2);
  box-shadow: 0 0 20px rgba(255,215,0,.2);
  transform: translateY(-1px);
}

.profile-customization-btn {
  width: 100%;
  max-width: 340px;
  margin-top: 10px;
  padding: 14px 20px;
  border: 2px solid rgba(185,242,255,.35);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(185,242,255,.1) 0%, rgba(185,242,255,.04) 100%);
  color: #b9f2ff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.25s ease;
}
.profile-customization-btn:hover {
  background: rgba(185,242,255,.18);
  box-shadow: 0 0 20px rgba(185,242,255,.2);
  transform: translateY(-1px);
}

.profile-panel-name {
  font-size: 24px;
  font-weight: 900;
  color: var(--text);
  margin-bottom: 8px;
  letter-spacing: 0.5px;
}

.profile-panel-balance-wrap {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 6px;
}
.profile-panel-balance {
  font-size: 36px;
  font-weight: 900;
  color: var(--gold);
  text-shadow: 0 0 24px rgba(255,215,0,.5);
  letter-spacing: 0.5px;
}
.profile-panel-balance-label {
  font-size: 16px;
  color: var(--muted);
}

.profile-panel-stats {
  width: 100%;
  max-width: 340px;
  min-width: 0;
  margin-top: 8px;
  padding: 20px 18px;
  background: rgba(255,255,255,.03);
  border: 1px solid var(--border);
  border-radius: var(--r);
  box-sizing: border-box;
}

.profile-stats-title {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: var(--muted);
  margin-bottom: 14px;
  text-align: center;
}

.profile-stat-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255,255,255,.06);
  font-size: 13px;
  min-width: 0;
}
.profile-stat-row:last-child { border-bottom: none; }
.profile-stat-name { color: var(--text); font-weight: 700; flex-shrink: 0; line-height: 1.35; }
.profile-stat-values {
  min-width: 0;
  text-align: right;
}

.profile-stat-block {
  display: flex;
  flex-direction: column;
  gap: 2px;
  line-height: 1.4;
}
.profile-stat-line {
  display: flex;
  justify-content: flex-end;
  align-items: baseline;
  gap: 6px;
}
.profile-stat-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: lowercase;
}
.profile-stat-num {
  font-size: 13px;
  font-weight: 800;
  color: var(--gold);
  letter-spacing: 0.3px;
}
.profile-stat-line.profile-stat-total .profile-stat-num {
  font-size: 14px;
}
.profile-stat-values .profile-stat-total.positive .profile-stat-num { color: var(--win-c); }
.profile-stat-values .profile-stat-total.negative .profile-stat-num { color: var(--lose-c); }

/* ── Ежедневные награды в профиле ── */
.profile-daily {
  width: 100%;
  max-width: 340px;
  margin-top: 16px;
  padding: 20px 18px;
  background: linear-gradient(165deg, rgba(255,215,0,.06) 0%, rgba(20,24,56,.95) 50%);
  border: 1px solid rgba(255,215,0,.25);
  border-radius: var(--r);
  box-shadow: 0 8px 32px rgba(0,0,0,.35);
}

.profile-daily-open-btn {
  width: 100%;
  padding: 14px 20px;
  border: 2px solid var(--gold);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255,215,0,.2) 0%, rgba(255,215,0,.08) 100%);
  color: var(--gold);
  font-family: inherit;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.3s ease;
}
.profile-daily-open-btn:hover {
  background: rgba(255,215,0,.25);
  box-shadow: 0 0 24px rgba(255,215,0,.3);
  transform: translateY(-2px);
}
.profile-daily-open-btn:active { transform: scale(0.98); }

.profile-bank-summary {
  width: 100%;
  max-width: 340px;
  margin-top: 10px;
  padding: 10px 14px;
  font-size: 13px;
  color: var(--muted);
  background: rgba(255,255,255,.03);
  border-radius: var(--r);
}
.profile-bank-label { font-weight: 600; }

/* ── Модалка: награды за месяц ── */
.daily-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.75);
  z-index: 2500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  overflow-y: auto;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}
.daily-overlay.open {
  opacity: 1;
  visibility: visible;
}

.daily-modal {
  position: relative;
  width: 100%;
  max-width: 380px;
  max-height: min(88vh, 88dvh);
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  background: linear-gradient(165deg, rgba(20,24,56,.98) 0%, #0a0c1a 100%);
  border: 2px solid rgba(255,215,0,.3);
  border-radius: var(--r);
  box-shadow: 0 0 48px rgba(255,215,0,.15), 0 24px 48px rgba(0,0,0,.5);
  padding: 16px;
  margin: auto;
  flex-shrink: 0;
}

.daily-modal-title {
  font-size: 15px;
  font-weight: 900;
  color: var(--gold);
  text-align: center;
  margin-bottom: 12px;
  text-shadow: 0 0 20px rgba(255,215,0,.3);
  flex-shrink: 0;
}

.daily-modal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin-bottom: 14px;
  min-height: 0;
}

.daily-day-cell {
  position: relative;
  aspect-ratio: 1;
  border-radius: 8px;
  border: 2px solid rgba(255,215,0,.2);
  background: rgba(0,0,0,.4);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3px;
  font-size: 10px;
  transition: all 0.25s ease;
}
.daily-day-cell .daily-day-num { font-weight: 800; color: var(--muted); line-height: 1.2; }
.daily-day-cell .daily-day-rew { font-size: 11px; font-weight: 900; color: var(--gold); margin-top: 1px; }

.daily-day-cell.claimed {
  border-color: rgba(46,204,113,.5);
  background: rgba(46,204,113,.12);
}
.daily-day-cell.claimed .daily-day-num,
.daily-day-cell.claimed .daily-day-rew { color: var(--win-c); }
.daily-day-cell.claimed::after {
  content: '✓';
  position: absolute;
  top: 2px;
  right: 4px;
  font-size: 10px;
  color: var(--win-c);
}

.daily-day-cell.today {
  border-color: var(--gold);
  background: rgba(255,215,0,.15);
  box-shadow: 0 0 16px rgba(255,215,0,.3);
  transform: scale(1.05);
  cursor: pointer;
}
.daily-day-cell.today .daily-day-num { color: var(--gold); }
.daily-day-cell.today:hover { box-shadow: 0 0 24px rgba(255,215,0,.45); }

.daily-day-cell.missed {
  opacity: 0.5;
  border-color: rgba(255,255,255,.1);
  background: rgba(0,0,0,.5);
  cursor: default;
}
.daily-day-cell.missed .daily-day-num,
.daily-day-cell.missed .daily-day-rew { color: var(--muted); }

.daily-day-cell.future {
  opacity: 0.6;
  border-color: rgba(255,215,0,.1);
  cursor: default;
}
.daily-day-cell.future .daily-day-num,
.daily-day-cell.future .daily-day-rew { color: var(--muted); }

.daily-modal-close {
  width: 100%;
  padding: 10px;
  border: 2px solid rgba(255,215,0,.3);
  border-radius: 12px;
  background: rgba(255,215,0,.08);
  color: var(--gold);
  flex-shrink: 0;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}
.daily-modal-close:hover {
  background: rgba(255,215,0,.15);
  border-color: var(--gold-dim);
}

@media (max-height: 520px) {
  .daily-overlay { padding: 8px; align-items: flex-start; }
  .daily-modal { max-height: min(94vh, 94dvh); padding: 10px; }
  .daily-modal-title { font-size: 13px; margin-bottom: 8px; }
  .daily-modal-grid { gap: 4px; margin-bottom: 10px; }
  .daily-day-cell { border-radius: 6px; padding: 2px; font-size: 9px; }
  .daily-day-cell .daily-day-rew { font-size: 10px; }
  .daily-modal-close { padding: 8px; font-size: 13px; }
}

.daily-reward-pop {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) scale(0.5);
  font-size: 36px;
  font-weight: 900;
  color: var(--gold);
  text-shadow: 0 0 24px rgba(255,215,0,.8);
  pointer-events: none;
  z-index: 10;
  opacity: 0;
}
.daily-reward-pop.hidden { display: none; }
.daily-reward-pop.show {
  display: block;
  animation: dailyRewardPop 1.2s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes dailyRewardPop {
  0%   { opacity: 0; transform: translate(-50%, -50%) scale(0.3); }
  15%  { opacity: 1; transform: translate(-50%, -50%) scale(1.2); }
  30%  { transform: translate(-50%, -50%) scale(1); }
  70%  { opacity: 1; transform: translate(-50%, -55%) scale(1.05); }
  100% { opacity: 0; transform: translate(-50%, -65%) scale(1.1); }
}

/* ══════════════ Достижения (рамки за выигрыши) ══════════════ */
.achievements-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.75);
  z-index: 2500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}
.achievements-overlay.open {
  opacity: 1;
  visibility: visible;
}

.achievements-modal {
  width: 100%;
  max-width: 380px;
  max-height: 85vh;
  overflow-y: auto;
  background: linear-gradient(165deg, rgba(20,24,56,.98) 0%, #0a0c1a 100%);
  border: 2px solid rgba(255,215,0,.35);
  border-radius: var(--r);
  box-shadow: 0 0 48px rgba(255,215,0,.12), 0 24px 48px rgba(0,0,0,.5);
  padding: 20px;
  animation: achievementsModalIn 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes achievementsModalIn {
  from { opacity: 0; transform: scale(0.92) translateY(-10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.achievements-title {
  font-size: 18px;
  font-weight: 900;
  color: var(--gold);
  text-align: center;
  margin-bottom: 8px;
  text-shadow: 0 0 20px rgba(255,215,0,.3);
}

.achievements-total {
  font-size: 14px;
  font-weight: 700;
  color: var(--muted);
  text-align: center;
  margin-bottom: 18px;
}

.achievements-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 18px;
}

.achievement-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border);
  border-radius: 14px;
  transition: all 0.25s ease;
}
.achievement-item.unlocked {
  border-color: rgba(46,204,113,.35);
  background: rgba(46,204,113,.06);
  box-shadow: 0 0 20px rgba(46,204,113,.1);
}
.achievement-item.locked {
  opacity: 0.85;
}

.achievement-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  flex-shrink: 0;
}
.achievement-icon.bronze { background: linear-gradient(145deg, #c9a057, #8b6914); box-shadow: 0 0 14px rgba(201,160,87,.4); }

/* ══════════════ Пальма лучших (рейтинг богачей) ══════════════ */
.profile-rich-btn {
  width: 100%;
  padding: 14px 18px;
  margin-bottom: 10px;
  font-size: 15px;
  font-weight: 700;
  color: var(--gold);
  background: linear-gradient(145deg, rgba(255,215,0,.12), rgba(255,180,0,.06));
  border: 1px solid rgba(255,215,0,.35);
  border-radius: var(--r);
  cursor: pointer;
  transition: all 0.2s ease;
}
.profile-rich-btn:active { transform: scale(0.98); }

.rich-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.8);
  z-index: 2500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}
.rich-overlay.open {
  opacity: 1;
  visibility: visible;
}

.rich-modal {
  width: 100%;
  max-width: 400px;
  max-height: 85vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: linear-gradient(165deg, rgba(20,24,56,.98) 0%, #0a0c1a 100%);
  border: 2px solid rgba(255,215,0,.35);
  border-radius: var(--r);
  box-shadow: 0 0 48px rgba(255,215,0,.12), 0 24px 48px rgba(0,0,0,.5);
  padding: 18px;
  animation: achievementsModalIn 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.rich-title {
  font-size: 20px;
  font-weight: 900;
  color: var(--gold);
  text-align: center;
  margin-bottom: 14px;
  text-shadow: 0 0 20px rgba(255,215,0,.3);
}

.rich-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}
.rich-tab {
  flex: 1;
  padding: 10px 12px;
  font-size: 14px;
  font-weight: 700;
  color: var(--muted);
  background: rgba(255,255,255,.06);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.rich-tab:hover { color: var(--text); background: rgba(255,255,255,.08); }
.rich-tab.active {
  color: var(--gold);
  background: rgba(255,215,0,.15);
  border-color: rgba(255,215,0,.4);
}

.rich-content {
  flex: 1;
  overflow-y: auto;
  min-height: 200px;
  margin-bottom: 14px;
}
.rich-content.hidden { display: none; }

.rich-loading {
  text-align: center;
  padding: 24px;
  color: var(--muted);
  font-size: 15px;
}

.rich-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  margin-bottom: 8px;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: background 0.2s ease;
}
.rich-row:nth-child(1) { border-color: rgba(255,215,0,.5); background: rgba(255,215,0,.08); }
.rich-row:nth-child(2) { border-color: rgba(192,192,192,.4); background: rgba(192,192,192,.06); }
.rich-row:nth-child(3) { border-color: rgba(205,127,50,.4); background: rgba(205,127,50,.06); }

.rich-rank {
  width: 28px;
  font-size: 16px;
  font-weight: 900;
  color: var(--muted);
  flex-shrink: 0;
}
.rich-row:nth-child(1) .rich-rank { color: var(--gold); }
.rich-row:nth-child(2) .rich-rank { color: #c0c0c0; }
.rich-row:nth-child(3) .rich-rank { color: #cd7f32; }

.rich-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: rgba(255,255,255,.1);
}

.rich-name {
  flex: 1;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rich-value {
  font-size: 14px;
  font-weight: 800;
  color: var(--gold);
  flex-shrink: 0;
}
.rich-value-detail {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  margin-top: 2px;
}

.rich-close {
  width: 100%;
  padding: 12px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  background: rgba(255,255,255,.08);
  border: 1px solid var(--border);
  border-radius: var(--r);
  cursor: pointer;
  transition: all 0.2s ease;
}
.rich-close:active { transform: scale(0.98); }
.achievement-icon.silver { background: linear-gradient(145deg, #e0e0e0, #909090); box-shadow: 0 0 14px rgba(192,192,192,.4); }
.achievement-icon.gold { background: linear-gradient(145deg, #ffd966, #c99400); box-shadow: 0 0 16px rgba(255,215,0,.45); }
.achievement-icon.diamond { background: linear-gradient(145deg, #b9f2ff, #5080b0); box-shadow: 0 0 18px rgba(185,242,255,.5); }

.achievement-body { flex: 1; min-width: 0; }
.achievement-name { font-size: 14px; font-weight: 800; color: var(--text); margin-bottom: 6px; }
.achievement-desc { font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.achievement-progress-wrap {
  height: 8px;
  background: rgba(0,0,0,.4);
  border-radius: 4px;
  overflow: hidden;
}
.achievement-progress-bar {
  height: 100%;
  border-radius: 4px;
  transition: width 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
.achievement-progress-bar.bronze { background: linear-gradient(90deg, #8b6914, #c9a057); }
.achievement-progress-bar.silver { background: linear-gradient(90deg, #606060, #c0c0c0); }
.achievement-progress-bar.gold { background: linear-gradient(90deg, #c99400, #ffd966); }
.achievement-progress-bar.diamond { background: linear-gradient(90deg, #5080b0, #b9f2ff); }

.achievement-action {
  flex-shrink: 0;
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
}
.achievement-item.locked .achievement-action {
  background: rgba(255,255,255,.06);
  border: 1px solid var(--border);
  color: var(--muted);
  cursor: default;
}
.achievement-item.unlocked .achievement-action {
  background: rgba(255,215,0,.2);
  border: 1px solid var(--gold);
  color: var(--gold);
}
.achievement-item.unlocked .achievement-action:hover { background: rgba(255,215,0,.35); box-shadow: 0 0 16px rgba(255,215,0,.25); }
.achievement-item.unlocked .achievement-action.active {
  background: rgba(46,204,113,.25);
  border-color: var(--win-c);
  color: var(--win-c);
  cursor: default;
}

.achievements-close {
  width: 100%;
  padding: 12px;
  border: 2px solid rgba(255,215,0,.3);
  border-radius: 12px;
  background: rgba(255,215,0,.08);
  color: var(--gold);
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}
.achievements-close:hover {
  background: rgba(255,215,0,.15);
  border-color: var(--gold-dim);
}

/* ══════════════ Кастомизация (выбор рамки) ══════════════ */
.customization-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.75);
  z-index: 2500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}
.customization-overlay.open {
  opacity: 1;
  visibility: visible;
}

.customization-modal {
  width: 100%;
  max-width: 380px;
  max-height: 85vh;
  overflow-y: auto;
  background: linear-gradient(165deg, rgba(20,24,56,.98) 0%, #0a0c1a 100%);
  border: 2px solid rgba(185,242,255,.3);
  border-radius: var(--r);
  box-shadow: 0 0 48px rgba(185,242,255,.1), 0 24px 48px rgba(0,0,0,.5);
  padding: 20px;
  animation: achievementsModalIn 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.customization-title {
  font-size: 18px;
  font-weight: 900;
  color: #b9f2ff;
  text-align: center;
  margin-bottom: 4px;
  text-shadow: 0 0 20px rgba(185,242,255,.3);
}

.customization-subtitle {
  font-size: 13px;
  color: var(--muted);
  text-align: center;
  margin-bottom: 18px;
}

.customization-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}

.customization-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 12px;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border);
  border-radius: 14px;
  transition: all 0.25s ease;
}
.customization-item.unlocked {
  border-color: rgba(185,242,255,.25);
  background: rgba(185,242,255,.04);
}

.customization-frame-preview {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
  position: relative;
  border: none;
  background: transparent;
  transition: all 0.25s ease;
}
.customization-frame-preview::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  padding: 3px;
  background: var(--preview-frame-fill);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  box-shadow: var(--preview-frame-glow);
}
.customization-frame-preview.bronze {
  --preview-frame-fill: linear-gradient(145deg, #e8c878 0%, #c9a057 35%, #8b6914 70%, #c9a057 100%);
  --preview-frame-glow: 0 0 12px rgba(201,160,87,.5);
}
.customization-frame-preview.silver {
  --preview-frame-fill: linear-gradient(145deg, #f0f0f0 0%, #c0c0c0 40%, #808080 70%, #c0c0c0 100%);
  --preview-frame-glow: 0 0 12px rgba(192,192,192,.5);
}
.customization-frame-preview.gold {
  --preview-frame-fill: linear-gradient(145deg, #ffe55c 0%, #ffd700 30%, #b8860b 65%, #ffd700 100%);
  --preview-frame-glow: 0 0 16px rgba(255,215,0,.5);
}
.customization-frame-preview.diamond {
  --preview-frame-fill: linear-gradient(145deg, #e0f7ff 0%, #b9f2ff 30%, #5eb8e8 65%, #b9f2ff 100%);
  --preview-frame-glow: 0 0 18px rgba(185,242,255,.55);
}
.customization-frame-preview.active::before {
  box-shadow: 0 0 20px rgba(46,204,113,.5), inset 0 0 12px rgba(46,204,113,.2);
}
.customization-frame-preview.active.bronze::before { background: linear-gradient(145deg, #2ecc71, #27ae60); }
.customization-frame-preview.active.silver::before { background: linear-gradient(145deg, #2ecc71, #27ae60); }
.customization-frame-preview.active.gold::before { background: linear-gradient(145deg, #2ecc71, #27ae60); }
.customization-frame-preview.active.diamond::before { background: linear-gradient(145deg, #2ecc71, #27ae60); }

/* Блик на золотой и алмазной в превью */
.customization-frame-preview.gold::after,
.customization-frame-preview.diamond::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  padding: 3px;
  background: linear-gradient(105deg, transparent 0%, transparent 35%, rgba(255,255,255,.5) 50%, transparent 65%, transparent 100%);
  background-size: 120% 100%;
  animation: frameShimmer 2.8s ease-in-out infinite;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}
.customization-frame-preview.diamond::after { animation-duration: 2.4s; }
.customization-frame-preview.active.gold::after,
.customization-frame-preview.active.diamond::after { display: none; }

.customization-frame-preview .customization-frame-icon {
  font-size: 28px;
  position: relative;
  z-index: 1;
}

.customization-item.locked .customization-frame-preview {
  opacity: 0.5;
  filter: grayscale(0.7);
}

.customization-frame-name {
  font-size: 12px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 10px;
  text-align: center;
}

.customization-select-btn {
  width: 100%;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid transparent;
}
.customization-select-btn.locked {
  background: rgba(255,255,255,.06);
  border-color: var(--border);
  color: var(--muted);
  cursor: default;
}
.customization-select-btn:not(.locked):not(.active) {
  background: rgba(185,242,255,.15);
  border-color: #b9f2ff;
  color: #b9f2ff;
}
.customization-select-btn:not(.locked):not(.active):hover {
  background: rgba(185,242,255,.25);
  box-shadow: 0 0 14px rgba(185,242,255,.25);
}
.customization-select-btn.active {
  background: rgba(46,204,113,.2);
  border-color: var(--win-c);
  color: var(--win-c);
  cursor: default;
}

.customization-close {
  width: 100%;
  padding: 12px;
  border: 2px solid rgba(185,242,255,.3);
  border-radius: 12px;
  background: rgba(185,242,255,.08);
  color: #b9f2ff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}
.customization-close:hover {
  background: rgba(185,242,255,.15);
  border-color: #b9f2ff;
}

/* ══════════════ SCRATCH CARDS ══════════════ */
.scratch-desc {
  font-size: 13px;
  color: var(--muted);
  text-align: center;
  margin: -8px 0 16px;
  line-height: 1.4;
}

.scratch-cards-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-bottom: 20px;
}

.scratch-card-btn {
  flex: 1;
  min-width: 72px;
  max-width: 88px;
  padding: 12px 8px;
  border-radius: 14px;
  border: 2px solid var(--border);
  background: rgba(255,255,255,.04);
  color: var(--text);
  font-family: inherit;
  cursor: pointer;
  transition: all 0.25s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.scratch-card-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,.3);
}
.scratch-card-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.scratch-card-btn .scratch-card-icon { font-size: 24px; }
.scratch-card-btn .scratch-card-name { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.5px; }
.scratch-card-btn .scratch-card-price { font-size: 14px; font-weight: 900; color: var(--gold); }

.scratch-card-btn.bronze  { border-color: rgba(205,127,50,.5); }
.scratch-card-btn.bronze:hover:not(:disabled) { border-color: #cd7f32; background: rgba(205,127,50,.12); }
.scratch-card-btn.silver  { border-color: rgba(192,192,192,.5); }
.scratch-card-btn.silver:hover:not(:disabled) { border-color: #c0c0c0; background: rgba(192,192,192,.12); }
.scratch-card-btn.gold    { border-color: rgba(255,215,0,.4); }
.scratch-card-btn.gold:hover:not(:disabled) { border-color: var(--gold); background: rgba(255,215,0,.12); }
.scratch-card-btn.diamond { border-color: rgba(185,242,255,.5); }
.scratch-card-btn.diamond:hover:not(:disabled) { border-color: #b9f2ff; background: rgba(185,242,255,.12); }

/* ══════════════ BLACKJACK ══════════════ */
.blackjack-card .game-title { margin-bottom: 4px; }
.blackjack-desc {
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  margin-bottom: 16px;
  line-height: 1.4;
}
.blackjack-table {
  background: linear-gradient(165deg, #0d2a0d 0%, #062006 50%, #051a05 100%);
  border-radius: 20px;
  padding: 20px 14px;
  margin-bottom: 16px;
  border: 2px solid rgba(255,215,0,.25);
  box-shadow: inset 0 0 40px rgba(0,0,0,.4), 0 0 24px rgba(0,80,0,.2);
}
.blackjack-dealer, .blackjack-player {
  text-align: center;
  min-height: 88px;
}
.blackjack-label {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
  display: block;
  margin-bottom: 8px;
}
.blackjack-hand {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  min-height: 72px;
}
.blackjack-total {
  font-size: 16px;
  font-weight: 800;
  color: var(--gold);
  margin-top: 6px;
}
.blackjack-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,215,0,.3), transparent);
  margin: 14px 0;
}
/* Карты */
.bj-card {
  width: 52px;
  height: 72px;
  border-radius: 8px;
  position: relative;
  transform-style: preserve-3d;
  animation: bjCardDeal 0.4s ease-out backwards;
  box-shadow: 0 4px 12px rgba(0,0,0,.45), 0 0 0 1px rgba(255,255,255,.15);
}
.bj-card:nth-child(1) { animation-delay: 0.05s; }
.bj-card:nth-child(2) { animation-delay: 0.15s; }
.bj-card:nth-child(3) { animation-delay: 0.25s; }
.bj-card:nth-child(4) { animation-delay: 0.35s; }
.bj-card:nth-child(5) { animation-delay: 0.45s; }
.bj-card:nth-child(6) { animation-delay: 0.55s; }
@keyframes bjCardDeal {
  from {
    opacity: 0;
    transform: translateY(-24px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
.bj-card-back {
  position: absolute;
  inset: 0;
  border-radius: 8px;
  background: linear-gradient(145deg, #1a237e 0%, #0d1545 50%, #1a237e 100%);
  border: 1px solid rgba(255,255,255,.2);
  box-shadow: inset 0 0 20px rgba(0,0,0,.3);
  display: flex;
  align-items: center;
  justify-content: center;
}
.bj-card-back::before {
  content: '🃏';
  font-size: 28px;
  opacity: 0.9;
}
.bj-card-face {
  position: absolute;
  inset: 0;
  border-radius: 8px;
  background: linear-gradient(165deg, #fffef8 0%, #f5f4ed 100%);
  border: 1px solid rgba(0,0,0,.12);
  padding: 4px 6px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
}
.bj-card-face.red { color: #b71c1c; }
.bj-card-face.black { color: #1a1a1a; }
.bj-card-rank { font-size: 14px; font-weight: 900; line-height: 1; }
.bj-card-suit { font-size: 20px; align-self: center; margin: auto 0; }
.bj-card-rank-bottom { font-size: 14px; font-weight: 900; transform: rotate(180deg); line-height: 1; }
.bj-card-flip {
  animation: bjCardFlip 0.5s ease-in-out forwards;
}
@keyframes bjCardFlip {
  from { transform: rotateY(0deg); }
  to { transform: rotateY(180deg); }
}
.blackjack-result {
  font-size: 15px;
  font-weight: 800;
  text-align: center;
  min-height: 24px;
  margin-bottom: 14px;
}
.blackjack-result.win { color: var(--win-c); }
.blackjack-result.lose { color: var(--lose-c); }
.blackjack-bet-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 12px;
}
.blackjack-bet-row .bet-row {
  margin: 0;
  min-width: 180px;
  flex: 1;
  max-width: 280px;
}
.blackjack-bet-row .bet-input {
  min-width: 80px;
  flex: 1;
}
.blackjack-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}
.blackjack-actions .play-btn { flex: 1; min-width: 120px; }
.blackjack-hit-stand { display: flex; gap: 10px; justify-content: center; flex: 1; min-width: 120px; }
.blackjack-hit-stand.hidden { display: none !important; }

/* Вся карта — металлик по типу (бронза/серебро/золото/алмаз) */
.scratch-arena {
  position: relative;
  margin-top: 8px;
  padding: 22px 20px;
  border-radius: 20px;
  text-align: center;
  overflow: hidden;
  box-shadow:
    inset 0 0 0 2px rgba(255,255,255,.2),
    inset 0 3px 12px rgba(255,255,255,.12),
    inset 0 -3px 10px rgba(0,0,0,.25),
    0 8px 28px rgba(0,0,0,.5),
    0 0 0 1px rgba(0,0,0,.25);
}
.scratch-arena::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(
    125deg,
    rgba(255,255,255,.35) 0%,
    rgba(255,255,255,.06) 35%,
    transparent 55%,
    rgba(0,0,0,.06) 80%,
    rgba(0,0,0,.18) 100%
  );
}
.scratch-arena.hidden { display: none; }

/* Бронза — вся карта */
.scratch-arena.bronze {
  background: linear-gradient(
    155deg,
    #e8c89a 0%,
    #c9a057 22%,
    #a67c3d 45%,
    #8b6914 65%,
    #6b4e1a 85%,
    #4a3510 100%
  );
}
.scratch-arena.bronze::before {
  background: linear-gradient(
    125deg,
    rgba(255,255,255,.4) 0%,
    transparent 40%,
    transparent 60%,
    rgba(0,0,0,.15) 100%
  );
}

/* Серебро */
.scratch-arena.silver {
  background: linear-gradient(
    155deg,
    #f0f2f5 0%,
    #d4d8e0 22%,
    #a8b0c0 45%,
    #788298 65%,
    #5c6478 85%,
    #3c4250 100%
  );
}
.scratch-arena.silver::before {
  background: linear-gradient(
    125deg,
    rgba(255,255,255,.5) 0%,
    transparent 38%,
    transparent 62%,
    rgba(0,0,0,.12) 100%
  );
}

/* Золото */
.scratch-arena.gold {
  background: linear-gradient(
    155deg,
    #fff4d4 0%,
    #ffd966 18%,
    #e6b800 42%,
    #c99400 62%,
    #8b6914 82%,
    #5c4508 100%
  );
}
.scratch-arena.gold::before {
  background: linear-gradient(
    125deg,
    rgba(255,255,255,.5) 0%,
    rgba(255,255,255,.1) 35%,
    transparent 55%,
    rgba(0,0,0,.1) 100%
  );
}

/* Алмаз — платина/холодный блеск */
.scratch-arena.diamond {
  background: linear-gradient(
    155deg,
    #f0f8ff 0%,
    #d0e8f8 20%,
    #a0c8e8 42%,
    #70a8d0 62%,
    #5080b0 80%,
    #305078 100%
  );
}
.scratch-arena.diamond::before {
  background: linear-gradient(
    125deg,
    rgba(255,255,255,.55) 0%,
    transparent 40%,
    transparent 60%,
    rgba(0,0,0,.08) 100%
  );
}

.scratch-card-surface {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-bottom: 18px;
  position: relative;
  z-index: 1;
}

/* Ячейки символов — «окна» на карте (тёмный вырез) */
.scratch-cell {
  position: relative;
  width: 78px;
  height: 96px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
  background: rgba(0,0,0,.45);
  box-shadow:
    inset 0 0 0 2px rgba(0,0,0,.4),
    inset 0 2px 6px rgba(0,0,0,.5),
    0 2px 10px rgba(0,0,0,.35);
}
.scratch-cell.revealed {
  background: rgba(0,0,0,.35);
  box-shadow:
    inset 0 0 0 2px rgba(255,255,255,.2),
    inset 0 2px 8px rgba(255,255,255,.08),
    0 4px 16px rgba(0,0,0,.4);
  animation: scratchReveal 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
.scratch-cell .scratch-symbol {
  position: relative;
  z-index: 1;
  font-size: 38px;
  font-weight: 900;
  color: var(--gold);
  text-shadow: 0 0 16px rgba(255,215,0,.45), 0 2px 8px rgba(0,0,0,.5);
}
.scratch-cell .scratch-symbol.jackpot {
  font-size: 44px;
  text-shadow: 0 0 24px rgba(255,215,0,.6), 0 2px 10px rgba(0,0,0,.4);
}

@keyframes scratchReveal {
  0%   { opacity: 0.85; transform: scale(0.95); }
  100% { opacity: 1;   transform: scale(1); }
}

.scratch-result-box {
  position: relative;
  z-index: 1;
  min-height: 44px;
  font-size: 18px;
  font-weight: 900;
  margin-bottom: 14px;
  border-radius: 12px;
  padding: 10px;
}
.scratch-result-box.win {
  background: rgba(46,204,113,.2);
  border: 1px solid rgba(46,204,113,.5);
  color: #1a5c34;
  text-shadow: 0 1px 0 rgba(255,255,255,.4);
  animation: popIn 0.4s ease;
}
.scratch-result-box.lose {
  background: rgba(0,0,0,.25);
  border: 1px solid rgba(0,0,0,.4);
  color: rgba(255,255,255,.9);
  text-shadow: 0 1px 2px rgba(0,0,0,.4);
}

.scratch-close-btn {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 200px;
  padding: 12px 20px;
  border: 2px solid rgba(0,0,0,.4);
  border-radius: 12px;
  background: rgba(0,0,0,.35);
  color: #fff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s;
  text-shadow: 0 1px 2px rgba(0,0,0,.5);
}
.scratch-close-btn:hover {
  background: rgba(0,0,0,.5);
  border-color: rgba(0,0,0,.5);
  box-shadow: 0 4px 16px rgba(0,0,0,.4);
}

/* ══════════════ BET CONTROLS ══════════════ */
.bet-controls { margin-bottom: 14px; min-width: 0; }

.bet-row {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 10px;
  min-width: 0;
}

.bet-adj {
  width: 44px; height: 44px; flex-shrink: 0;
  border: 2px solid var(--border);
  border-radius: 10px;
  background: rgba(255,215,0,.08);
  color: var(--gold);
  font-size: 22px; font-weight: 700;
  cursor: pointer; transition: all .2s;
  display: flex; align-items: center; justify-content: center;
}
.bet-adj:hover { background: rgba(255,215,0,.18); border-color: var(--gold-dim); }
.bet-adj:active { transform: scale(.9); }

.bet-input {
  flex: 1; min-width: 0; height: 44px;
  width: 0;
  background: rgba(255,255,255,.04);
  border: 2px solid var(--border);
  border-radius: 10px;
  color: var(--text); font-family: inherit;
  font-size: 20px; font-weight: 900;
  text-align: center; outline: none;
  transition: border-color .2s;
}
.bet-input:focus { border-color: var(--gold-dim); }
.bet-input::-webkit-inner-spin-button,
.bet-input::-webkit-outer-spin-button { -webkit-appearance: none; }

.bet-presets { display: flex; gap: 8px; min-width: 0; flex-wrap: wrap; }
.bet-presets button {
  flex: 1; min-width: 0; padding: 8px 4px;
  border: 2px solid rgba(255,215,0,.25);
  border-radius: 8px;
  background: rgba(255,215,0,.08);
  color: #ffd700;
  font-family: inherit; font-size: 13px; font-weight: 800;
  text-shadow: 0 0 12px rgba(255,215,0,.5);
  cursor: pointer; transition: all .2s;
}
.bet-presets button:hover {
  background: rgba(255,215,0,.18);
  color: #fff;
  border-color: var(--gold-dim);
  text-shadow: 0 0 14px rgba(255,215,0,.6);
}

.bet-mult-row {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  min-width: 0;
}
.bet-mult-row .bet-mult-btn {
  flex: 1;
  min-width: 0;
  padding: 12px 8px;
  border: 2px solid rgba(255,215,0,.25);
  border-radius: 10px;
  background: rgba(255,215,0,.08);
  color: var(--gold);
  font-family: inherit;
  font-size: 18px;
  font-weight: 900;
  cursor: pointer;
  transition: all .2s;
}
.bet-mult-row .bet-mult-btn:hover {
  background: rgba(255,215,0,.18);
  border-color: var(--gold-dim);
  color: #fff;
}
.bet-mult-row .bet-mult-btn:active {
  transform: scale(0.97);
}

/* ══════════════ PLAY BUTTON ══════════════ */
.play-btn {
  width: 100%; padding: 16px;
  background: linear-gradient(135deg, #b8860b 0%, #ffd700 50%, #b8860b 100%);
  background-size: 200% 100%;
  border: none; border-radius: 14px;
  color: #1a0f00;
  font-family: inherit; font-size: 15px; font-weight: 900;
  letter-spacing: 2.5px; text-transform: uppercase;
  cursor: pointer; transition: all .3s;
  box-shadow: 0 4px 24px rgba(255,215,0,.4), inset 0 1px 0 rgba(255,255,255,.3);
  position: relative; overflow: hidden;
  margin-bottom: 14px;
}
.play-btn:hover:not(:disabled) {
  background-position: 100% 0;
  box-shadow: 0 6px 32px rgba(255,215,0,.6), inset 0 1px 0 rgba(255,255,255,.3);
  transform: translateY(-1px);
}
.play-btn:active:not(:disabled) { transform: scale(.97) translateY(0); }
.play-btn:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }

/* shimmer on hover */
.play-btn::after {
  content: '';
  position: absolute; top: 0; left: -80%;
  width: 50%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.25), transparent);
  transform: skewX(-20deg);
  transition: left .6s;
}
.play-btn:hover:not(:disabled)::after { left: 130%; }

/* ══════════════ RESULT BOX ══════════════ */
.result-box {
  min-height: 48px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 12px;
  font-size: 15px; font-weight: 700; text-align: center;
  padding: 10px;
  transition: all .3s;
}
.result-box.win {
  background: rgba(46,204,113,.12);
  border: 1px solid rgba(46,204,113,.4);
  color: var(--win-c);
  animation: popIn .4s ease;
}
.result-box.lose {
  background: rgba(231,76,60,.08);
  border: 1px solid rgba(231,76,60,.25);
  color: var(--lose-c);
  animation: popIn .4s ease;
}

/* ══════════════ COIN ══════════════ */
.coin-arena {
  display: flex; flex-direction: column;
  align-items: center; gap: 10px;
  margin-bottom: 18px;
}

.coin-scene {
  width: 120px; height: 120px;
  perspective: 600px;
  display: flex; align-items: center; justify-content: center;
}

.coin {
  width: 110px; height: 110px;
  position: relative;
  transform-style: preserve-3d;
}

/* Гурт монеты — виден при вращении */
.coin-edge {
  position: absolute;
  left: 0; top: 50%;
  width: 100%; height: 10px;
  margin-top: -5px;
  background: linear-gradient(180deg, #8b6914 0%, #b8860b 50%, #8b6914 100%);
  border-radius: 2px;
  transform: rotateX(90deg);
  transform-style: preserve-3d;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.2), 0 1px 3px rgba(0,0,0,.3);
}

.coin-face {
  position: absolute; inset: 0;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 46px; font-weight: 900;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border: 3px solid;
  box-shadow: 0 3px 12px rgba(0,0,0,.4);
}

/* Орёл: лёгкий блик для объёма, без «дырки» в центре */
.coin-front {
  background: radial-gradient(ellipse 75% 75% at 35% 30%, #f5e6a8 0%, #e2c24a 40%, #c9a227 85%, #a67c00 100%);
  border-color: #8b6914;
  color: rgba(0,0,0,.35);
  transform: translateZ(5px);
}

/* Решка: серебро с мягким бликом */
.coin-back {
  background: radial-gradient(ellipse 75% 75% at 35% 30%, #e8e8e8 0%, #c0c0c0 40%, #909090 85%, #606060 100%);
  border-color: #505050;
  color: rgba(0,0,0,.4);
  transform: rotateY(180deg) translateZ(-5px);
}

.coin-payout-info { font-size: 13px; color: var(--muted); }

/* Coin state helpers (set via JS style.transform) */

.choice-row {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 18px;
}

.choice-btn {
  flex: 1; padding: 16px 10px;
  border: 2px solid var(--border);
  border-radius: 14px;
  background: rgba(255,255,255,.03);
  color: var(--muted);
  font-family: inherit; font-size: 22px;
  cursor: pointer; transition: all .3s;
  text-align: center;
  line-height: 1.3;
}
.choice-btn span { display: block; font-size: 11px; font-weight: 800; letter-spacing: 1px; margin-top: 4px; }

.choice-btn.active {
  border-color: var(--gold);
  background: rgba(255,215,0,.1);
  color: var(--gold);
  box-shadow: var(--glow);
}

.choice-vs {
  font-size: 12px; font-weight: 800; color: var(--muted);
  letter-spacing: 1px;
}

/* ══════════════ ROULETTE (статичное колесо + крутящийся указатель) ══════════════ */
.roulette-arena {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
  padding: 10px;
}

.roulette-wrap {
  position: relative;
  width: 200px;
  height: 200px;
}

/* Статичное колесо: градиент задаётся из JS по порядку европейской рулетки */
.roulette-wheel {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(255,215,0,.35), inset 0 0 24px rgba(0,0,0,.5);
  transition: none;
}

.roulette-pointer-wrap {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 24px;
  height: 100px;
  margin-left: -12px;
  margin-top: -100px;
  transform-origin: 12px 100px;
  transform: rotate(0deg);
  z-index: 5;
  transition: transform 0.1s;
}

.roulette-pointer-wrap.spinning {
  transition: transform 2.8s cubic-bezier(.08,.4,.2,1);
}

.roulette-pointer {
  width: 0;
  height: 0;
  margin-left: 0;
  border-left: 12px solid transparent;
  border-right: 12px solid transparent;
  border-top: 28px solid var(--gold);
  filter: drop-shadow(0 2px 6px rgba(0,0,0,.6));
}

/* Центр: только цвет результата (без числа), с анимациями */
.roulette-center {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: #0e1128;
  border: 3px solid rgba(255,215,0,.35);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 2px 12px rgba(0,0,0,.5);
  z-index: 4;
  transition: background .25s, border-color .25s, box-shadow .25s, transform .25s;
}

.roulette-center.r-red {
  background: radial-gradient(circle at 35% 35%, #e74c3c, #c0392b 60%, #8e2a22);
  border-color: rgba(231,76,60,.7);
  box-shadow: 0 0 24px rgba(231,76,60,.5), inset 0 1px 0 rgba(255,255,255,.2);
}
.roulette-center.r-black {
  background: radial-gradient(circle at 35% 35%, #3d3d3d, #1a1a1a 60%, #0d0d0d);
  border-color: rgba(255,255,255,.25);
  box-shadow: 0 0 20px rgba(0,0,0,.7), inset 0 1px 0 rgba(255,255,255,.08);
}
.roulette-center.r-green {
  background: radial-gradient(circle at 35% 35%, #2ecc71, #1e8449 60%, #156534);
  border-color: rgba(39,174,96,.7);
  box-shadow: 0 0 24px rgba(39,174,96,.5), inset 0 1px 0 rgba(255,255,255,.2);
}

/* Анимация появления результата */
.roulette-center.roulette-center-reveal {
  animation: rouletteCenterReveal 0.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes rouletteCenterReveal {
  0% {
    transform: translate(-50%, -50%) scale(0.6);
    opacity: 0.5;
    box-shadow: 0 0 0 0 rgba(255,255,255,.4);
  }
  50% {
    transform: translate(-50%, -50%) scale(1.08);
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
}

/* color choice buttons */
.color-choices {
  display: flex; flex-direction: column; gap: 10px;
  margin-bottom: 18px;
}

.color-btn {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 16px;
  border: 2px solid var(--border);
  border-radius: 12px;
  background: rgba(255,255,255,.03);
  color: var(--muted);
  font-family: inherit; font-size: 14px; font-weight: 700;
  cursor: pointer; transition: all .3s;
}

.c-dot { font-size: 18px; flex-shrink: 0; }
.c-name { flex: 1; text-align: left; }
.c-mult {
  background: rgba(255,215,0,.12);
  color: var(--gold); font-weight: 800;
  padding: 2px 10px; border-radius: 20px; font-size: 12px;
}

.color-btn.c-red.active  { border-color: #e74c3c; background: rgba(231,76,60,.12); color: #ff7070; box-shadow: 0 0 18px rgba(231,76,60,.25); }
.color-btn.c-green.active{ border-color: #27ae60; background: rgba(39,174,96,.12); color: #5dda80; box-shadow: 0 0 18px rgba(39,174,96,.25); }
.color-btn.c-black.active{ border-color: #888; background: rgba(255,255,255,.08); color: var(--text); box-shadow: 0 0 14px rgba(255,255,255,.08); }
.color-btn:hover:not(.active) { color: var(--text); background: rgba(255,255,255,.06); }

/* ══════════════ WIN OVERLAY ══════════════ */
.win-overlay {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.65);
  backdrop-filter: blur(6px);
  animation: fadeIn .3s ease;
  cursor: pointer;
}
.win-overlay.hidden { display: none; }

.win-box {
  text-align: center; position: relative;
  animation: winPop .55s cubic-bezier(.36,.07,.19,.97);
}

.win-stars {
  position: absolute; top: -30px; left: 50%; transform: translateX(-50%);
  width: 200px; height: 60px; pointer-events: none;
}

.win-trophy { font-size: 80px; line-height: 1; filter: drop-shadow(0 0 24px rgba(255,215,0,.8)); }

.win-label {
  font-size: 13px; font-weight: 800; letter-spacing: 3px;
  color: var(--muted); margin-top: 6px;
}

.win-amount {
  font-size: 60px; font-weight: 900; line-height: 1;
  color: var(--gold);
  text-shadow: 0 0 40px rgba(255,215,0,.9);
}

.win-currency { font-size: 22px; color: var(--text); margin-top: 2px; }

.win-tap { font-size: 12px; color: var(--muted); margin-top: 16px; }

/* ══════════════ TOAST ══════════════ */
.toast {
  position: fixed; bottom: 24px; left: 50%;
  transform: translateX(-50%);
  background: #1e2248;
  border: 1px solid rgba(255,215,0,.2);
  color: var(--text);
  padding: 10px 20px;
  border-radius: 24px;
  font-size: 14px; font-weight: 600;
  z-index: 300;
  max-width: 80%; text-align: center;
  animation: slideUp .3s ease;
  white-space: nowrap;
}
.toast.hidden { display: none; }

/* Уведомление о достижении (сверху, поверх всего, непрозрачное) */
.achievement-toast {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  background: var(--card);
  border: 1px solid var(--border);
  border-top: none;
  border-bottom: 3px solid var(--gold);
  color: var(--text);
  box-shadow: 0 12px 40px rgba(0,0,0,.6), 0 0 24px rgba(255,215,0,.12);
  animation: achievementToastIn 0.4s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.achievement-toast.hidden { display: none; }
.achievement-toast.show {
  display: flex;
  animation: achievementToastIn 0.4s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.achievement-toast.hiding {
  animation: achievementToastOut 0.35s ease forwards;
}

.achievement-toast-icon {
  font-size: 32px;
  flex-shrink: 0;
  filter: drop-shadow(0 0 10px rgba(255,215,0,.4));
}

.achievement-toast-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.achievement-toast-title {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: var(--gold);
  text-transform: uppercase;
}

.achievement-toast-name {
  font-size: 17px;
  font-weight: 900;
  color: var(--text);
  text-shadow: 0 0 16px rgba(255,215,0,.25);
}

.achievement-toast-reward {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}

@keyframes achievementToastIn {
  from {
    opacity: 0;
    transform: translateY(-100%);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes achievementToastOut {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(-100%);
  }
}

/* ══════════════ KEYFRAMES ══════════════ */
@keyframes reelBlur {
  0%   { transform: translateY(0);    filter: blur(0px); }
  50%  { transform: translateY(-12px); filter: blur(1.5px); }
  100% { transform: translateY(0);    filter: blur(0px); }
}

@keyframes reelLand {
  0%   { transform: scale(1); }
  30%  { transform: scale(1.18) rotate(-1deg); }
  60%  { transform: scale(.94); }
  80%  { transform: scale(1.05); }
  100% { transform: scale(1); }
}

@keyframes rouletteSpin {
  0%   { transform: rotate(0deg); }
  100% { transform: rotate(1440deg); }
}

@keyframes balancePop {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.25); color: var(--win-c); text-shadow: 0 0 24px rgba(46,204,113,.7); }
  100% { transform: scale(1); color: var(--gold); }
}

@keyframes popIn {
  from { transform: scale(.8); opacity: 0; }
  to   { transform: scale(1);  opacity: 1; }
}

@keyframes winPop {
  from { transform: scale(.2) rotate(-8deg); opacity: 0; }
  60%  { transform: scale(1.08) rotate(2deg); }
  to   { transform: scale(1) rotate(0deg); opacity: 1; }
}

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

@keyframes slideUp {
  from { transform: translate(-50%, 20px); opacity: 0; }
  to   { transform: translate(-50%, 0);    opacity: 1; }
}

@keyframes cardIn {
  from { transform: translateY(10px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

@keyframes starBurst {
  0%   { transform: translate(-50%,-50%) scale(0); opacity: 1; }
  100% { transform: translate(-50%,-50%) scale(3); opacity: 0; }
}

/* Scrollbar */
::-webkit-scrollbar { width: 3px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gold-dim); border-radius: 2px; }
