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

:root {
  --bg: #0a0a18;

  --text-primary: rgba(255, 255, 255, 0.95);
  --text-secondary: rgba(255, 255, 255, 0.55);
  --text-tertiary: rgba(255, 255, 255, 0.3);

  --accent: #a78bfa;
  --accent-blue: #60a5fa;
  --accent-green: #34d399;
  --accent-orange: #fb923c;

  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
}

html, body {
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  overflow-x: hidden;
  font-family: -apple-system, 'SF Pro Display', 'SF Pro Text', 'Inter', BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

#starfield {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.hidden { display: none !important; }

.screen {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  min-width: 0;
  max-width: 100%;
  overflow-x: hidden;
  box-sizing: border-box;
}

.app-screen {
  min-width: 0;
  min-height: 0;
}

/* ============================
   LIQUID GLASS SYSTEM
   Pure blur + subtle tint, no shine
   ============================ */

.glass {
  background: rgba(30, 30, 50, 0.45);
  backdrop-filter: blur(48px) saturate(1.1);
  -webkit-backdrop-filter: blur(48px) saturate(1.1);
  border: 0.5px solid rgba(255, 255, 255, 0.06);
  border-radius: 18px;
}

.glass-subtle {
  background: rgba(20, 20, 40, 0.4);
  backdrop-filter: blur(48px) saturate(1.1);
  -webkit-backdrop-filter: blur(48px) saturate(1.1);
  border-bottom: 0.5px solid rgba(255, 255, 255, 0.05);
}

.glass-btn {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 0.5px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
}

.glass-nav {
  background: rgba(25, 25, 45, 0.55);
  backdrop-filter: blur(56px) saturate(1.1);
  -webkit-backdrop-filter: blur(56px) saturate(1.1);
  border: 0.5px solid rgba(255, 255, 255, 0.07);
  border-radius: 22px;
}

/* ===== LOADER ===== */
.loader {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.8s;
}

.loader.fade-out {
  opacity: 0;
  visibility: hidden;
}

.loader-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
}

.loader-logo-wrap {
  display: flex;
  align-items: center;
  gap: 0;
  height: 48px;
}

.loader-star {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  opacity: 0;
  transform: scale(0.5);
  animation: loaderStarIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.2s forwards;
}

@keyframes loaderStarIn {
  to { opacity: 1; transform: scale(1); }
}

.loader-text-clip {
  overflow: hidden;
  width: 0;
  animation: loaderTextReveal 0.6s cubic-bezier(0.4, 0, 0.2, 1) 0.9s forwards;
}

@keyframes loaderTextReveal {
  to { width: min(180px, calc(100vw - 72px)); }
}

.loader-text {
  display: block;
  height: 28px;
  width: min(180px, calc(100vw - 72px));
  max-width: 100%;
  margin-left: 6px;
}

.loader-bar-track {
  width: min(180px, calc(100vw - 72px));
  max-width: 100%;
  height: 2px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 1px;
  overflow: hidden;
}

.loader-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #103FEA, #29BDF9);
  border-radius: 1px;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.loader-hint {
  font-size: 12px;
  color: var(--text-tertiary);
  letter-spacing: 0.5px;
  animation: blink-text 2.5s ease-in-out infinite;
}

@keyframes blink-text {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 0.8; }
}

/* ===== AUTH SCREEN ===== */
.auth-screen {
  align-items: center;
  justify-content: center;
  padding: 24px calc(20px + var(--safe-right)) 24px calc(20px + var(--safe-left));
  animation: fadeIn 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.auth-card {
  width: 100%;
  max-width: 360px;
  padding: 36px 24px 32px;
  text-align: center;
}

.auth-header {
  margin-bottom: 32px;
}

.auth-logo-img {
  height: 36px;
  width: auto;
  margin-bottom: 16px;
}

.auth-header p {
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 400;
}

.auth-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.auth-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 13px 20px;
  border: none;
  border-radius: 14px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.auth-btn:active { transform: scale(0.97); opacity: 0.85; }

.auth-btn svg { width: 20px; height: 20px; flex-shrink: 0; }

.telegram-btn {
  background: #2AABEE;
  color: #fff;
}

.google-btn {
  background: rgba(255, 255, 255, 0.95);
  color: #1f1f1f;
}

/* ===== APP HEADER ===== */
.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px calc(12px + var(--safe-right)) 8px calc(12px + var(--safe-left));
  padding-top: calc(8px + var(--safe-top));
  min-height: 52px;
  gap: 8px;
  min-width: 0;
  flex-shrink: 0;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex-shrink: 1;
}

.header-logo {
  height: 24px;
  width: auto;
  flex-shrink: 0;
}

.header-online {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px 2px 6px;
  border-radius: 999px;
  background: rgba(52, 211, 153, 0.1);
  border: 0.5px solid rgba(52, 211, 153, 0.2);
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #6ee7b7;
  white-space: nowrap;
  flex-shrink: 0;
}

.header-online-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 6px rgba(52, 211, 153, 0.75);
  flex-shrink: 0;
  animation: headerOnlineBlink 1.1s ease-in-out infinite;
}

@keyframes headerOnlineBlink {
  0%, 100% { opacity: 1; }
  45% { opacity: 0.25; }
  55% { opacity: 0.25; }
}

.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  justify-content: flex-end;
  min-width: 0;
}

.balance-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 5px 5px 10px;
  border-radius: 20px;
  cursor: default;
  min-width: 0;
  max-width: 100%;
  flex-shrink: 1;
}

.balance-icon {
  width: 18px;
  height: 19px;
  flex-shrink: 0;
}

.sg-currency-icon {
  display: block;
}

.balance-amount {
  font-size: clamp(11px, 3.2vw, 13px);
  font-weight: 700;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  max-width: min(132px, 38vw);
}

.balance-add {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #103FEA, #29BDF9);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.15s ease;
}

.balance-add:active { transform: scale(0.9); }

.balance-add svg {
  width: 14px;
  height: 14px;
}

.avatar-btn {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  transition: transform 0.15s ease;
}

.avatar-btn:active { transform: scale(0.9); }

.avatar {
  position: relative;
  overflow: hidden;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #103FEA, #29BDF9);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
  color: #fff;
  flex-shrink: 0;
  border: 1.5px solid rgba(41, 189, 249, 0.3);
}

.avatar-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

/* ===== APP CONTENT ===== */
.app-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px calc(12px + var(--safe-right)) 0 calc(12px + var(--safe-left));
  min-width: 0;
  min-height: 0;
  -webkit-overflow-scrolling: touch;
}

.app-content::-webkit-scrollbar { display: none; }

/* ===== STAT TILES (всегда одна строка — три компактные плитки) ===== */
.stats-tiles {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 6px;
  margin-bottom: 10px;
  min-width: 0;
}

.stile {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 6px;
  border-radius: 10px;
  background: rgba(30, 30, 50, 0.35);
  border: 0.5px solid rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  box-sizing: border-box;
}

.stile-avatar {
  position: relative;
  overflow: hidden;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 11px;
  color: #fff;
  flex-shrink: 0;
}

.stile-avatar-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.stile-empty-av {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-tertiary);
  font-size: 10px;
}

.stile-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
  gap: 1px;
}

.stile-title {
  font-size: 8px;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.2px;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stile-name {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stile-val {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stile-val .stile-sub {
  font-weight: 500;
  font-size: 9px;
  color: #34d399;
}

.bottom-spacer-game { height: 180px; }

/* ===== ROUND INFO ===== */
.round-info {
  padding: 18px clamp(12px, 4vw, 16px) 14px;
  margin-bottom: 12px;
  text-align: center;
  max-width: 100%;
  box-sizing: border-box;
}

.pool-label {
  font-size: 11px;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 6px;
}

.pool-row {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
  max-width: 100%;
}

.pool-star {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}

.pool-value {
  font-size: clamp(22px, 9vw, 32px);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.round-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  padding: 10px 0 0;
  border-top: 0.5px solid rgba(255, 255, 255, 0.05);
  max-width: 100%;
}

.round-divider {
  width: 1px;
  height: 16px;
  background: rgba(255, 255, 255, 0.08);
}

.round-timer-wrap {
  position: relative;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}

.timer-ring {
  width: 32px;
  height: 32px;
}

#timerCircle {
  transition: stroke-dashoffset 0.4s ease;
}

.timer-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.meta-item {
  font-size: clamp(10px, 3.2vw, 12px);
  color: var(--text-secondary);
  white-space: nowrap;
  font-weight: 500;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.round-status {
  margin-top: 10px;
  font-size: clamp(11px, 3.4vw, 12px);
  color: var(--text-tertiary);
  text-align: center;
  padding: 0 4px;
  line-height: 1.35;
  word-wrap: break-word;
  overflow-wrap: anywhere;
}

.status-highlight {
  color: #34d399;
  font-weight: 700;
}

/* ===== FIRST BET BONUS BANNER ===== */
.first-bet-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  margin-bottom: 12px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(16, 63, 234, 0.15), rgba(52, 211, 153, 0.12));
  border: 1px solid rgba(52, 211, 153, 0.2);
  transition: opacity 0.3s ease, height 0.3s ease, padding 0.3s ease, margin 0.3s ease;
  overflow: hidden;
  min-width: 0;
  max-width: 100%;
}

.first-bet-banner.fbb-hidden {
  opacity: 0;
  height: 0;
  padding: 0 16px;
  margin-bottom: 0;
  border: none;
  pointer-events: none;
}

.fbb-icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(52, 211, 153, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
}

.fbb-icon svg {
  width: 20px;
  height: 20px;
  color: #34d399;
}

.fbb-text {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.3;
}

.fbb-text strong {
  color: #34d399;
  font-weight: 700;
  font-size: 14px;
}

/* ===== ROULETTE ===== */
.roulette-section {
  position: relative;
  margin-bottom: 12px;
  overflow: hidden;
  border-radius: 14px;
  height: 120px;
  background: rgba(30, 30, 50, 0.3);
  border: 0.5px solid rgba(255, 255, 255, 0.06);
  transition: height 0.3s ease, opacity 0.3s ease, margin 0.3s ease;
}

.roulette-section.roulette-hidden {
  height: 0;
  opacity: 0;
  margin-bottom: 0;
  border: none;
}

.roulette-pointer {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  height: 100%;
  background: linear-gradient(180deg, #29BDF9, rgba(41, 189, 249, 0.2));
  z-index: 2;
}

.roulette-pointer::before {
  content: '';
  position: absolute;
  top: -2px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 8px solid #29BDF9;
}

.roulette-track {
  width: 100%;
  height: 100%;
  overflow: hidden;
  position: relative;
}

.roulette-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  will-change: transform;
  padding: 0 8px;
}

.roulette-strip.spinning {
  justify-content: flex-start;
  padding: 0;
}

.roulette-item {
  position: relative;
  overflow: hidden;
  width: 76px;
  height: 76px;
  flex-shrink: 0;
  margin: 0 4px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 22px;
  color: #fff;
  border: 2px solid rgba(255, 255, 255, 0.1);
}

.roulette-item-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.roulette-player-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
  margin: 0 8px;
}

.rpt-avatar {
  position: relative;
  overflow: hidden;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 20px;
  color: #fff;
  border: 2px solid rgba(255, 255, 255, 0.12);
}

.rpt-avatar-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.rpt-chance {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

.rpt-bonus {
  color: #34d399;
  font-size: 10px;
  font-weight: 700;
}

.bet-amount-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  flex-shrink: 1;
  min-width: 0;
}

.bet-bonus-tag {
  color: #34d399;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
}

.bet-item-first {
  border: 1px solid rgba(52, 211, 153, 0.2);
  background: rgba(52, 211, 153, 0.04);
}

/* ===== BETS LIST ===== */
.bets-section {
  margin-bottom: 12px;
}

.bets-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  padding: 0 2px;
}

.bets-header h3 {
  font-size: 15px;
  font-weight: 600;
}

.bets-total {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-tertiary);
}

.bets-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 260px;
  overflow-y: auto;
}

.bets-list::-webkit-scrollbar { display: none; }

.bet-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(30, 30, 50, 0.35);
  border: 0.5px solid rgba(255, 255, 255, 0.04);
  animation: betSlideIn 0.3s ease both;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

@keyframes betSlideIn {
  from { opacity: 0; transform: translateX(-20px); }
  to { opacity: 1; transform: translateX(0); }
}

.bet-color {
  width: 4px;
  height: 32px;
  border-radius: 2px;
  flex-shrink: 0;
}

.bet-avatar {
  position: relative;
  overflow: hidden;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 12px;
  color: #fff;
  flex-shrink: 0;
}

.bet-avatar-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

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

.bet-name {
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bet-amount-display {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: clamp(12px, 3.5vw, 14px);
  font-weight: 700;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  min-width: 0;
  flex-shrink: 1;
}

.bet-currency-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.bets-progress-track {
  height: 3px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 8px;
}

.bets-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #103FEA, #29BDF9);
  border-radius: 2px;
  transition: width 0.3s ease;
  width: 0%;
}

/* ===== BET PANEL ===== */
.bet-panel {
  position: fixed;
  bottom: 90px;
  left: calc(12px + var(--safe-left));
  right: calc(12px + var(--safe-right));
  z-index: 25;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-sizing: border-box;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
}

.bet-panel.bet-panel-closed {
  transform: translateY(20px);
  opacity: 0;
  pointer-events: none;
}

.bet-quick-btns {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.bet-quick {
  flex: 1;
  padding: 6px;
  border: 0.5px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.bet-quick:active {
  transform: scale(0.95);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

.bet-input-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}

.bet-input {
  flex: 1 1 140px;
  min-width: 0;
  padding: 10px 14px;
  border: 0.5px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  outline: none;
  -moz-appearance: textfield;
}

.bet-input::placeholder { color: var(--text-tertiary); }
.bet-input::-webkit-outer-spin-button,
.bet-input::-webkit-inner-spin-button { -webkit-appearance: none; }

.bet-input:focus {
  border-color: rgba(41, 189, 249, 0.3);
}

.bet-submit {
  padding: 10px 24px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #103FEA, #29BDF9);
  color: #fff;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.15s ease;
}

.bet-submit:active { transform: scale(0.95); }

.bet-submit:disabled {
  opacity: 0.4;
  pointer-events: none;
}

/* ===== TAB CONTENT ===== */
.tab-content {
  animation: fadeIn 0.3s ease;
  min-width: 0;
  max-width: 100%;
}

.tab-content > section {
  max-width: 100%;
  box-sizing: border-box;
}

/* ===== PROFILE ===== */
.profile-card {
  padding: 28px 20px;
  margin-bottom: 12px;
  text-align: center;
}

.profile-avatar-big {
  position: relative;
  overflow: hidden;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, #103FEA, #29BDF9);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 700;
  color: #fff;
  margin: 0 auto 12px;
  border: 2px solid rgba(41, 189, 249, 0.3);
}

.profile-avatar-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}


.profile-name {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 20px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 0 8px;
  box-sizing: border-box;
}

.profile-balance-block {
  margin-bottom: 20px;
}

.profile-bal-label {
  font-size: 11px;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 6px;
}

.profile-bal-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.profile-bal-icon {
  width: 24px;
  height: 24px;
}

.profile-bal-value {
  font-size: clamp(20px, 7vw, 28px);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.profile-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  min-width: 0;
}

.profile-action-btn {
  flex: 1 1 140px;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px;
  border: none;
  border-radius: 14px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease;
}

.profile-action-btn:active { transform: scale(0.96); }
.profile-action-btn svg { width: 18px; height: 18px; }

.deposit-btn {
  background: linear-gradient(135deg, #103FEA, #29BDF9);
  color: #fff;
}

.withdraw-btn {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
  border: 0.5px solid rgba(255, 255, 255, 0.08);
}

/* History */
.history-section {
  padding: 18px;
  margin-bottom: 12px;
}

.history-title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 12px;
}

.history-list { min-height: 60px; }

.history-empty {
  text-align: center;
  padding: 20px 0;
  color: var(--text-tertiary);
  font-size: 13px;
}

.history-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 8px;
  margin: 0 -8px;
  border-radius: 10px;
}

.history-item + .history-item {
  border-top: 0.5px solid rgba(255, 255, 255, 0.04);
}

.history-item-win {
  background: rgba(52, 211, 153, 0.06);
  border: 0.5px solid rgba(52, 211, 153, 0.12);
}

.history-item-loss {
  background: rgba(255, 255, 255, 0.02);
}

.history-result {
  width: 32px;
  height: 32px;
  margin-top: 2px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}

.history-result.win {
  background: rgba(52, 211, 153, 0.15);
  color: var(--accent-green);
}

.history-result.loss {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

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

.history-round {
  font-size: 13px;
  font-weight: 500;
  margin: 0 0 4px;
}

.history-winner,
.history-my-chance {
  font-size: 11px;
  color: var(--text-secondary);
  margin: 0 0 2px;
  line-height: 1.35;
}

.history-winner strong,
.history-my-chance strong {
  color: var(--text-primary);
  font-weight: 600;
}

.history-when {
  font-size: 11px;
  color: var(--text-tertiary);
  margin: 4px 0 0;
}

.history-amount {
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 2px;
}

.history-amount.positive { color: var(--accent-green); }
.history-amount.negative { color: #ef4444; }

/* ===== BONUSES ===== */
.referral-banner {
  padding: 20px;
  margin-bottom: 12px;
}

.banner-top {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 16px;
  min-width: 0;
}

.banner-text {
  flex: 1;
  min-width: 0;
}

.banner-text h3 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 4px;
}

.banner-text p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.banner-text strong {
  color: var(--text-primary);
  font-weight: 600;
}

.banner-cta {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px;
  border: none;
  border-radius: 14px;
  background: linear-gradient(135deg, #103FEA, #29BDF9);
  color: #fff;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease;
}

.banner-cta:active { transform: scale(0.97); }
.banner-cta svg { width: 18px; height: 18px; }

.referral-card {
  padding: 24px 20px;
  margin-bottom: 12px;
  text-align: center;
}

.referral-icon-wrap {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(16, 63, 234, 0.2), rgba(41, 189, 249, 0.2));
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
  color: var(--accent-blue);
}

.referral-icon-wrap svg { width: 24px; height: 24px; }

.referral-card h3 {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 6px;
}

.referral-link-row {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
}

.referral-input {
  flex: 1;
  padding: 10px 12px;
  border: 0.5px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 12px;
  outline: none;
  text-overflow: ellipsis;
}

.referral-copy-btn {
  width: 42px;
  height: 42px;
  border: 0.5px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: color 0.2s ease;
}

.referral-copy-btn svg { width: 18px; height: 18px; }

.referral-stats {
  display: flex;
  gap: 16px;
  justify-content: center;
}

.ref-stat { text-align: center; }

.ref-stat-val {
  display: block;
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 2px;
}

.ref-stat-label {
  font-size: 11px;
  color: var(--text-tertiary);
}

/* Referral perks */
.referral-perks {
  display: flex;
  gap: 10px;
  margin: 14px 0 18px;
}

.referral-perk {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 0.5px solid rgba(255, 255, 255, 0.06);
}

.perk-badge {
  min-width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #103FEA, #29BDF9);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
  padding: 0 6px;
}

.referral-perk p {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.3;
  text-align: left;
}

/* Friends list */
.friends-section {
  padding: 18px;
  margin-bottom: 12px;
}

.friends-title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 12px;
}

.friends-list { min-height: 60px; }

.friends-empty {
  text-align: center;
  padding: 20px 0;
  color: var(--text-tertiary);
}

.friends-empty svg {
  width: 36px;
  height: 36px;
  margin-bottom: 8px;
  opacity: 0.4;
}

.friends-empty p {
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 4px;
  color: var(--text-secondary);
}

.friends-empty span {
  font-size: 11px;
}

.friend-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
}

.friend-item + .friend-item {
  border-top: 0.5px solid rgba(255, 255, 255, 0.04);
}

.friend-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
  color: #fff;
  flex-shrink: 0;
}

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

.friend-name {
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.friend-status {
  font-size: 11px;
  color: var(--text-tertiary);
}

.friend-earnings {
  text-align: right;
  flex-shrink: 0;
}

.friend-earned {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent-green);
}

.friend-earned-label {
  font-size: 10px;
  color: var(--text-tertiary);
}

/* Promo */
.promo-card {
  padding: 20px;
  margin-bottom: 12px;
}

.promo-card h3 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 4px;
}

.promo-desc {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.promo-input-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}

.promo-input {
  flex: 1 1 160px;
  min-width: 0;
  padding: 10px 14px;
  border: 0.5px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 14px;
  outline: none;
}

.promo-input::placeholder { color: var(--text-tertiary); }

.promo-input:focus { border-color: rgba(41, 189, 249, 0.3); }

.promo-submit {
  flex: 0 1 auto;
  padding: 10px 20px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #103FEA, #29BDF9);
  color: #fff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.15s ease;
}

.promo-submit:active { transform: scale(0.95); }

/* ===== MODALS ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
  animation: fadeIn 0.2s ease;
}

.modal-card {
  width: 100%;
  max-width: 440px;
  border-radius: 22px 22px 0 0;
  padding: 20px 20px calc(20px + var(--safe-bottom));
  animation: modalSlideUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalSlideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.modal-header h3 {
  font-size: 17px;
  font-weight: 700;
}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.modal-close svg { width: 18px; height: 18px; }

.withdraw-lock-banner {
  margin-bottom: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(239, 68, 68, 0.12);
  border: 0.5px solid rgba(239, 68, 68, 0.25);
  color: #fca5a5;
  font-size: 12px;
  line-height: 1.5;
}

.withdraw-lock-banner strong {
  color: #f87171;
  display: block;
  margin-bottom: 4px;
  font-size: 13px;
}

.modal-methods {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.method-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 0.5px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-primary);
  font-family: inherit;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s ease, transform 0.15s ease;
  min-width: 0;
  max-width: 100%;
}

.method-btn:active { transform: scale(0.98); background: rgba(255, 255, 255, 0.06); }

.method-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.method-icon svg { width: 20px; height: 20px; }

.stars-icon {
  background: rgba(251, 191, 36, 0.12);
  color: #fbbf24;
}

.crypto-icon {
  background: rgba(96, 165, 250, 0.12);
  color: var(--accent-blue);
}

.sbp-icon {
  background: rgba(52, 211, 153, 0.12);
  color: var(--accent-green);
}

.method-name {
  font-size: 15px;
  font-weight: 600;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.method-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.method-desc {
  font-size: 12px;
  color: var(--text-tertiary);
  line-height: 1.3;
}

.method-arrow {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--text-tertiary);
}

.method-btn-dim {
  opacity: 0.7;
}

.method-hint {
  font-size: 12px;
  color: var(--text-tertiary);
  flex-shrink: 0;
}

/* ===== DEPOSIT STEP 2 ===== */
.dep-back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  padding: 0;
  margin-bottom: 18px;
}

.dep-back svg {
  width: 16px;
  height: 16px;
}

.dep-amount-display {
  text-align: center;
  margin-bottom: 20px;
}

.dep-amount-value {
  font-size: 44px;
  font-weight: 700;
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.1;
}

.dep-amount-label {
  font-size: 13px;
  color: var(--text-tertiary);
  margin-top: 4px;
}

.dep-presets {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.dep-preset {
  padding: 12px 0;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.dep-preset:active {
  transform: scale(0.96);
}

.dep-preset-active {
  border-color: rgba(251, 191, 36, 0.5);
  background: rgba(251, 191, 36, 0.1);
  color: #fbbf24;
}

.dep-custom-row {
  margin-bottom: 16px;
}

.dep-custom-input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text-primary);
  font-size: 15px;
  font-family: inherit;
  outline: none;
  box-sizing: border-box;
}

.dep-custom-input:focus {
  border-color: rgba(251, 191, 36, 0.45);
}

.dep-custom-input::placeholder {
  color: var(--text-tertiary);
}

.dep-pay-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 15px 20px;
  border: none;
  border-radius: 14px;
  background: linear-gradient(135deg, #f59e0b, #fbbf24);
  color: #0a0a18;
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.dep-pay-btn:active {
  transform: scale(0.97);
  opacity: 0.9;
}

.dep-pay-star {
  width: 18px;
  height: 18px;
}

.dep-pay-btn-rub {
  background: linear-gradient(135deg, #4ade80, #22d3ee);
}

.dep-rub-hint {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 4px;
  opacity: 0.8;
}

.dep-preset-rub-active {
  border-color: rgba(74, 222, 128, 0.5) !important;
  background: rgba(74, 222, 128, 0.1) !important;
  color: #4ade80 !important;
}

.dep-amount-value-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.dep-amount-star {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
}

.dep-star-icon {
  width: 14px;
  height: 14px;
  vertical-align: -1px;
  flex-shrink: 0;
}

.dep-preset {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

/* Star icon inside stat tiles */
.stile-star {
  width: 10px;
  height: 10px;
  vertical-align: -1px;
  margin-right: 2px;
  flex-shrink: 0;
}

/* ===== WINNER POPUP ===== */
.winner-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(16px, var(--safe-top)) max(12px, var(--safe-right)) max(24px, var(--safe-bottom)) max(12px, var(--safe-left));
  box-sizing: border-box;
  background: rgba(0, 0, 0, 0.6);
  animation: fadeIn 0.3s ease;
}

.winner-card {
  padding: clamp(20px, 5vw, 28px) clamp(16px, 4vw, 24px);
  text-align: center;
  max-width: min(360px, 100%);
  width: 100%;
  box-sizing: border-box;
  animation: slideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.winner-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.6px;
  color: var(--text-tertiary);
  margin: 0 0 14px;
}

.winner-avatar-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 12px;
}

.winner-avatar {
  position: relative;
  overflow: hidden;
  width: clamp(64px, 18vw, 88px);
  height: clamp(64px, 18vw, 88px);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(22px, 6vw, 30px);
  font-weight: 700;
  color: #fff;
  border: 2px solid rgba(255, 255, 255, 0.15);
  flex-shrink: 0;
}

.winner-avatar-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.winner-name {
  font-size: clamp(17px, 4.5vw, 22px);
  font-weight: 700;
  margin: 0 0 6px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 0 4px;
  line-height: 1.3;
}

.winner-sub {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin: 0 0 12px;
  line-height: 1.35;
  padding: 0 8px;
  word-break: break-word;
}

.winner-amount {
  font-size: clamp(22px, 6vw, 30px);
  font-weight: 800;
  background: linear-gradient(135deg, #103FEA, #29BDF9);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
  margin: 0;
}

/* ===== BOTTOM NAVIGATION ===== */
.bottom-nav {
  position: fixed;
  bottom: 12px;
  left: calc(12px + var(--safe-left));
  right: calc(12px + var(--safe-right));
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 6px 2px;
  padding-bottom: calc(6px + var(--safe-bottom));
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 6px 6px;
  background: none;
  border: none;
  color: var(--text-tertiary);
  font-family: inherit;
  font-size: 10px;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.2s ease;
  position: relative;
}

.nav-item svg {
  width: 21px;
  height: 21px;
  transition: all 0.2s ease;
}

.nav-item.active { color: var(--accent); }

.nav-item:active { transform: scale(0.88); }

.center-btn {
  padding: 0;
  margin-top: -18px;
}

.center-btn-inner {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-blue));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 4px 20px -4px rgba(167, 139, 250, 0.35);
  transition: transform 0.15s ease;
}

.center-btn:active .center-btn-inner { transform: scale(0.9); }

.center-btn-inner svg {
  width: 22px;
  height: 22px;
  color: #fff;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.center-btn.panel-open .center-btn-inner svg {
  transform: rotate(45deg);
}

/* ===== ANIMATIONS ===== */
@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.app-screen .stats-tiles { animation: slideUp 0.35s cubic-bezier(0.4, 0, 0.2, 1) 0s both; }
.app-screen .round-info { animation: slideUp 0.35s cubic-bezier(0.4, 0, 0.2, 1) 0.05s both; }
.app-screen .first-bet-banner { animation: slideUp 0.35s cubic-bezier(0.4, 0, 0.2, 1) 0.08s both; }
.app-screen .roulette-section { animation: slideUp 0.35s cubic-bezier(0.4, 0, 0.2, 1) 0.1s both; }
.app-screen .bets-section { animation: slideUp 0.35s cubic-bezier(0.4, 0, 0.2, 1) 0.15s both; }

.stile {
  transition: transform 0.15s ease, background 0.2s ease;
}
.stile:active { transform: scale(0.97); }

.pool-value {
  transition: transform 0.2s ease;
}

@keyframes poolPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.06); }
  100% { transform: scale(1); }
}

.balance-amount {
  transition: transform 0.15s ease;
}

@keyframes balanceBump {
  0% { transform: scale(1); }
  30% { transform: scale(1.12); }
  100% { transform: scale(1); }
}

.modal-overlay {
  animation: modalFadeIn 0.25s ease;
}

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

.modal-card {
  animation: modalSlideUp 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.method-btn {
  transition: background 0.2s ease, transform 0.15s ease, border-color 0.2s ease;
}
.method-btn:hover {
  background: rgba(255, 255, 255, 0.06);
}

.dep-preset {
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.dep-pay-btn {
  transition: transform 0.15s ease, opacity 0.15s ease, box-shadow 0.2s ease;
}
.dep-pay-btn:hover {
  box-shadow: 0 4px 20px -4px rgba(245, 158, 11, 0.3);
}
.dep-pay-btn-rub:hover {
  box-shadow: 0 4px 20px -4px rgba(74, 222, 128, 0.3);
}

.bet-submit {
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}
.bet-submit:hover {
  box-shadow: 0 4px 16px -4px rgba(16, 63, 234, 0.35);
}

.winner-card {
  animation: winnerPop 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes winnerPop {
  0% { opacity: 0; transform: scale(0.85) translateY(30px); }
  60% { transform: scale(1.02) translateY(-4px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

.history-item {
  transition: background 0.2s ease;
}

.profile-action-btn {
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}
.deposit-btn:hover {
  box-shadow: 0 4px 16px -4px rgba(16, 63, 234, 0.3);
}

.banner-cta {
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}
.banner-cta:hover {
  box-shadow: 0 4px 16px -4px rgba(16, 63, 234, 0.3);
}

.tab-content {
  animation: tabFadeIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
@keyframes tabFadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== RESPONSIVE ===== */
@media (min-width: 500px) {
  .bottom-nav, .bet-panel {
    max-width: min(440px, calc(100vw - 24px - var(--safe-left) - var(--safe-right)));
    left: calc(12px + var(--safe-left));
    right: calc(12px + var(--safe-right));
    margin-left: auto;
    margin-right: auto;
  }
}

@media (max-width: 420px) {
  .bet-input-row .bet-submit,
  .promo-input-row .promo-submit {
    flex: 1 1 100%;
    width: 100%;
  }
  .dep-presets {
    gap: 6px;
  }
  .dep-preset {
    padding: 10px 0;
    font-size: 13px;
  }
  .dep-amount-value {
    font-size: 36px;
  }
  .dep-amount-star {
    width: 24px;
    height: 24px;
  }
  .referral-perks {
    flex-direction: column;
  }
}

@media (max-width: 340px) {
  .stile {
    gap: 4px;
    padding: 6px 4px;
  }
  .stile-avatar {
    width: 26px;
    height: 26px;
    font-size: 9px;
  }
  .stile-name {
    font-size: 10px;
  }
  .stile-val {
    font-size: 9px;
  }
  .stile-title {
    font-size: 7px;
  }
}

@media (hover: hover) {
  .auth-btn:hover { opacity: 0.9; }
  .bet-quick:hover { background: rgba(255, 255, 255, 0.08); color: var(--text-primary); }
  .nav-item:hover { color: var(--text-secondary); }
}

/* ===== NICKNAME MODAL ===== */
.nickname-modal {
  position: fixed;
  inset: 0;
  z-index: 20000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px calc(16px + var(--safe-right)) 24px calc(16px + var(--safe-left));
  padding-top: calc(24px + var(--safe-top));
  padding-bottom: calc(24px + var(--safe-bottom));
  background: rgba(5, 5, 15, 0.72);
  backdrop-filter: blur(10px);
  box-sizing: border-box;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.nickname-card {
  width: 100%;
  max-width: min(380px, 100%);
  padding: 22px 20px 20px;
  border-radius: 20px;
  box-sizing: border-box;
}

.nickname-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
}

.nickname-hint {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.45;
  margin-bottom: 14px;
}

.nickname-photo-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 12px;
}

.nickname-photo {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.12);
}

.nickname-input {
  width: 100%;
  padding: 14px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text-primary);
  font-size: 16px;
  outline: none;
}

.nickname-input:focus {
  border-color: rgba(167, 139, 250, 0.55);
}

.nickname-error {
  margin-top: 8px;
  font-size: 12px;
  color: #fb7185;
}

.nickname-submit {
  width: 100%;
  margin-top: 14px;
  padding: 14px 16px;
  border: 0;
  border-radius: 14px;
  font-weight: 600;
  font-size: 15px;
  color: #0a0a18;
  background: linear-gradient(135deg, #c4b5fd, #60a5fa);
  cursor: pointer;
}

.nickname-submit:active {
  transform: scale(0.98);
}

/* ===== WELCOME (rules + registration bonus) ===== */
.welcome-modal {
  position: fixed;
  inset: 0;
  z-index: 20001;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px calc(16px + var(--safe-right)) 24px calc(16px + var(--safe-left));
  padding-top: calc(24px + var(--safe-top));
  padding-bottom: calc(24px + var(--safe-bottom));
  background: rgba(5, 5, 15, 0.75);
  backdrop-filter: blur(10px);
  box-sizing: border-box;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.welcome-card {
  width: 100%;
  max-width: min(400px, 100%);
  padding: 22px 20px 20px;
  border-radius: 20px;
  box-sizing: border-box;
}

.welcome-title {
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 10px;
}

.welcome-bonus {
  font-size: 14px;
  color: var(--accent-green);
  font-weight: 500;
  line-height: 1.45;
  margin: 0 0 16px;
}

.welcome-rules-heading {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.welcome-rules-list {
  margin: 0;
  padding-left: 18px;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.welcome-rules-list li {
  margin-bottom: 8px;
}

.welcome-rules-list li:last-child {
  margin-bottom: 0;
}

.welcome-rules-list strong {
  color: var(--text-primary);
  font-weight: 600;
}

.welcome-ok {
  width: 100%;
  margin-top: 18px;
  padding: 14px 16px;
  border: 0;
  border-radius: 14px;
  font-weight: 600;
  font-size: 15px;
  color: #0a0a18;
  background: linear-gradient(135deg, #c4b5fd, #60a5fa);
  cursor: pointer;
}

.welcome-ok:active {
  transform: scale(0.98);
}
