:root {
  --bg-1: #141225;
  --bg-2: #1b1830;
  --card: rgba(255,255,255,0.045);
  --card-border: rgba(255,255,255,0.08);
  --text: #f1eefc;
  --hint: #9a94b8;
  --accent: #8b6cf2;
  --accent-2: #5b8cf0;
  --accent-text: #ffffff;
  --win: #3ddc84;
  --lose: #ff6b81;
  --tie: #f5c96b;
  --radius: 18px;
  --radius-sm: 12px;
}

* { box-sizing: border-box; }

html, body {
  min-height: 100%;
}

body {
  margin: 0;
  background:
    radial-gradient(1200px 600px at 15% -10%, rgba(139,108,242,0.18), transparent 60%),
    radial-gradient(1000px 500px at 100% 0%, rgba(91,140,240,0.14), transparent 55%),
    linear-gradient(180deg, var(--bg-1), var(--bg-2) 60%, var(--bg-1));
  background-attachment: fixed;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  padding-bottom: 28px;
  -webkit-tap-highlight-color: transparent;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(20, 18, 37, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  padding: 14px 16px;
  display: flex;
  justify-content: center;
  border-bottom: 1px solid var(--card-border);
}
.balance { display: flex; gap: 22px; font-size: 15px; }
.balance-item {
  transition: transform 0.25s cubic-bezier(.34,1.56,.64,1);
  background: var(--card);
  border: 1px solid var(--card-border);
  padding: 6px 12px;
  border-radius: 999px;
}
.balance-item.bump { animation: bump 0.4s cubic-bezier(.34,1.56,.64,1); }
@keyframes bump { 0% { transform: scale(1); } 45% { transform: scale(1.22); box-shadow: 0 0 0 6px rgba(139,108,242,0.12); } 100% { transform: scale(1); } }

.tabs {
  display: flex;
  gap: 6px;
  padding: 12px 12px 6px;
  position: relative;
}
.tab {
  flex: 1;
  padding: 11px 6px;
  border: none;
  border-radius: 14px;
  background: var(--card);
  border: 1px solid var(--card-border);
  color: var(--hint);
  font-size: 13px;
  font-weight: 600;
  transition: background 0.25s ease, color 0.25s ease, transform 0.18s ease, box-shadow 0.25s ease;
}
.tab.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: var(--accent-text);
  border-color: transparent;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px -8px rgba(139,108,242,0.65);
}
.tab:active { transform: scale(0.96); }

main { padding: 0 16px; }

.screen { display: none; }
.screen.active { display: block; animation: fadeIn 0.32s cubic-bezier(.22,1,.36,1); }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px) scale(0.99); } to { opacity: 1; transform: translateY(0) scale(1); } }

h2 { font-size: 18px; margin: 16px 0 10px; font-weight: 700; letter-spacing: 0.2px; }
h3 { font-size: 13px; color: var(--hint); margin: 20px 0 8px; text-transform: uppercase; letter-spacing: 0.6px; }

.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 14px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: border-color 0.25s ease;
}

.field-row { margin-bottom: 14px; }
.field-row label { display: block; font-size: 13px; color: var(--hint); margin-bottom: 7px; }
input[type="number"] {
  width: 100%;
  padding: 11px 13px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--card-border);
  background: rgba(0,0,0,0.18);
  color: var(--text);
  font-size: 16px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
input[type="number"]:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(139,108,242,0.22); }
input[type="range"] { width: 100%; accent-color: var(--accent); }

.segmented { display: flex; background: rgba(0,0,0,0.18); border-radius: var(--radius-sm); padding: 3px; }
.seg {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--hint);
  padding: 9px 0;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 600;
  transition: background 0.25s ease, color 0.25s ease;
}
.seg.active { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: var(--accent-text); }

.primary-btn {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: var(--accent-text);
  font-size: 15px;
  font-weight: 700;
  box-shadow: 0 10px 24px -10px rgba(139,108,242,0.6);
  transition: transform 0.15s ease, opacity 0.2s ease, box-shadow 0.2s ease;
}
.primary-btn:active { transform: scale(0.97); box-shadow: 0 4px 14px -8px rgba(139,108,242,0.5); }
.primary-btn:disabled { opacity: 0.45; box-shadow: none; }

.secondary-btn {
  width: 100%;
  padding: 11px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid var(--card-border);
  color: var(--hint);
  font-size: 14px;
  margin-top: 10px;
  transition: border-color 0.2s ease, color 0.2s ease;
}
.secondary-btn:active { transform: scale(0.97); }

.predicted-payout { font-size: 13px; color: var(--hint); margin-bottom: 12px; }
.predicted-payout b { color: var(--win); }

.deposits-list { display: flex; flex-direction: column; gap: 8px; }
.deposit-row {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  padding: 13px 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  gap: 10px;
}
.deposit-row .dep-status { color: var(--hint); white-space: nowrap; }
.deposit-row .claim-btn {
  background: linear-gradient(135deg, var(--win), #2bb56d);
  color: #06210f;
  border: none;
  border-radius: 8px;
  padding: 7px 14px;
  font-weight: 700;
  font-size: 12px;
  animation: pulse-ready 1.8s ease infinite;
}
@keyframes pulse-ready { 0%, 100% { box-shadow: 0 0 0 0 rgba(61,220,132,0.4); } 50% { box-shadow: 0 0 0 6px rgba(61,220,132,0); } }

.active-deposit-banner {
  background: linear-gradient(135deg, rgba(139,108,242,0.16), rgba(91,140,240,0.1));
  border: 1px solid rgba(139,108,242,0.35);
  border-radius: var(--radius-sm);
  padding: 13px 15px;
  margin-bottom: 14px;
  font-size: 13px;
}
.active-deposit-banner .adb-title { font-weight: 700; margin-bottom: 4px; }
.active-deposit-banner .adb-hint { color: var(--hint); }

/* КАЗИНО */
.casino-card { text-align: center; }

.game-tabs { display: flex; gap: 6px; margin-bottom: 14px; }
.game-tab {
  flex: 1;
  padding: 9px 4px;
  border-radius: 10px;
  border: 1px solid var(--card-border);
  background: rgba(0,0,0,0.18);
  color: var(--hint);
  font-size: 12px;
  font-weight: 600;
  transition: background 0.25s ease, color 0.25s ease, transform 0.15s ease;
}
.game-tab.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: var(--accent-text);
}

.game-stage { min-height: 92px; display: flex; align-items: center; justify-content: center; margin-bottom: 10px; }

.reels {
  display: flex;
  justify-content: center;
  gap: 10px;
}
.reel {
  width: 62px;
  height: 62px;
  background: rgba(0,0,0,0.22);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  overflow: hidden;
}
.reel.spinning { animation: spin-reel 0.12s linear infinite; }
@keyframes spin-reel {
  0% { transform: translateY(-6px); filter: blur(1px); }
  50% { transform: translateY(6px); filter: blur(1px); }
  100% { transform: translateY(-6px); filter: blur(1px); }
}
.reel.landed { animation: land 0.45s cubic-bezier(.34,1.56,.64,1); }
@keyframes land { 0% { transform: scale(1.35) rotate(-6deg); } 100% { transform: scale(1) rotate(0); } }

.dice-box {
  width: 84px; height: 84px;
  border-radius: 20px;
  background: rgba(0,0,0,0.22);
  border: 1px solid var(--card-border);
  display: flex; align-items: center; justify-content: center;
  font-size: 46px;
}
.dice-box.rolling { animation: dice-roll 0.1s linear infinite; }
@keyframes dice-roll { 0% { transform: rotate(0deg) scale(1); } 50% { transform: rotate(180deg) scale(1.08); } 100% { transform: rotate(360deg) scale(1); } }
.dice-box.landed { animation: land 0.45s cubic-bezier(.34,1.56,.64,1); }

.coin {
  width: 84px; height: 84px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ffe08a, #d9a441);
  display: flex; align-items: center; justify-content: center;
  font-size: 34px;
  box-shadow: inset 0 0 0 3px rgba(0,0,0,0.15);
}
.coin.flipping { animation: coin-flip 0.16s linear infinite; }
@keyframes coin-flip { 0% { transform: rotateY(0deg) scaleX(1); } 50% { transform: rotateY(180deg) scaleX(0.15); } 100% { transform: rotateY(360deg) scaleX(1); } }
.coin.landed { animation: land 0.45s cubic-bezier(.34,1.56,.64,1); }

.result-text { min-height: 24px; font-weight: 700; font-size: 15px; margin: 8px 0 14px; }
.result-text.win { color: var(--win); animation: pop 0.4s cubic-bezier(.34,1.56,.64,1); }
.result-text.lose { color: var(--lose); }
.result-text.tie { color: var(--tie); }
.result-text.error { color: var(--lose); font-weight: 600; font-size: 13px; }
@keyframes pop { 0% { transform: scale(0.6); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }

.bet-presets { display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }
.bet-presets button {
  flex: 1;
  min-width: 50px;
  background: rgba(0,0,0,0.18);
  border: 1px solid var(--card-border);
  color: var(--text);
  border-radius: 9px;
  padding: 8px 0;
  font-size: 12px;
  transition: background 0.2s ease, transform 0.15s ease;
}
.bet-presets button:active { transform: scale(0.95); }

/* PVP */
.hidden { display: none !important; }

.radar {
  width: 96px;
  height: 96px;
  margin: 12px auto 18px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.radar::before, .radar::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid var(--accent);
  opacity: 0.6;
  animation: radar-pulse 1.7s ease-out infinite;
}
.radar::after { animation-delay: 0.85s; }
@keyframes radar-pulse {
  0% { transform: scale(0.6); opacity: 0.6; }
  100% { transform: scale(2); opacity: 0; }
}
.radar-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 14px 2px rgba(139,108,242,0.7); }

#pvpSearching { text-align: center; }

.vs-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.player-badge {
  background: rgba(0,0,0,0.2);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 600;
  flex: 1;
  text-align: center;
}
.vs-label { padding: 0 10px; color: var(--hint); font-weight: 700; font-size: 12px; }

.pvp-timer { height: 6px; background: rgba(0,0,0,0.25); border-radius: 4px; overflow: hidden; margin-bottom: 18px; }
.pvp-timer-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  width: 100%;
  transform-origin: left;
}
.pvp-timer-bar.running { animation: countdown linear forwards; }
@keyframes countdown { from { width: 100%; } to { width: 0%; } }

.choices { display: flex; justify-content: center; gap: 16px; margin-bottom: 12px; }
.choice-btn {
  width: 66px;
  height: 66px;
  border-radius: 50%;
  border: 2px solid var(--card-border);
  background: rgba(0,0,0,0.2);
  font-size: 28px;
  transition: transform 0.18s cubic-bezier(.34,1.56,.64,1), border-color 0.18s ease, box-shadow 0.18s ease;
}
.choice-btn:active { transform: scale(0.88); }
.choice-btn.selected { border-color: var(--accent); transform: scale(1.12); box-shadow: 0 0 0 6px rgba(139,108,242,0.15); }

.muted { text-align: center; color: var(--hint); font-size: 13px; }

.reveal-row { display: flex; align-items: center; justify-content: center; gap: 18px; margin-bottom: 12px; }
.reveal-emoji {
  font-size: 46px;
  animation: reveal-shake 0.55s cubic-bezier(.34,1.56,.64,1);
}
@keyframes reveal-shake {
  0% { transform: rotate(0) scale(0.3); opacity: 0; }
  45% { transform: rotate(-14deg) scale(1.2); opacity: 1; }
  70% { transform: rotate(8deg) scale(1); }
  100% { transform: rotate(0) scale(1); }
}

.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(28, 24, 48, 0.95);
  border: 1px solid var(--card-border);
  color: var(--text);
  padding: 11px 18px;
  border-radius: 12px;
  font-size: 13px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.4);
  animation: toast-in 0.3s cubic-bezier(.34,1.56,.64,1);
  z-index: 50;
  max-width: 88vw;
  text-align: center;
}
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 16px) scale(0.95); } to { opacity: 1; transform: translate(-50%, 0) scale(1); } }
