/*
 * Оформление сайта.
 *
 * Тёмная витрина казино: глубокий фон, стеклянные карточки, один акцентный
 * градиент. Анимации короткие и всегда что-то означают — барабан крутится,
 * пока сервер думает; выигрыш вспыхивает; проигрыш вздрагивает. Движения без
 * смысла тут нет, иначе интерфейс превращается в мигалку.
 */

:root {
  --bg: #0b0d17;
  --bg-2: #12152a;
  --card: rgba(255, 255, 255, 0.045);
  --card-line: rgba(255, 255, 255, 0.09);
  --ink: #eef0ff;
  --muted: #9098c0;
  --brand: #5865f2;
  --brand-2: #9b5cff;
  --win: #3ddc84;
  --lose: #ff5c72;
  --gold: #ffc84a;
  --radius: 18px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 "Segoe UI", system-ui, -apple-system, sans-serif;
  overflow-x: hidden;
}

/* ── Фон ──────────────────────────────────────────────────────────────── */

.aurora { position: fixed; inset: 0; z-index: -1; overflow: hidden; background: radial-gradient(120% 90% at 50% -20%, #1a1f45 0%, var(--bg) 60%); }
.aurora i {
  position: absolute;
  width: 55vmax; height: 55vmax;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.32;
  animation: drift 26s ease-in-out infinite alternate;
}
.aurora i:first-child { background: var(--brand); top: -18vmax; left: -12vmax; }
.aurora i:last-child { background: var(--brand-2); bottom: -22vmax; right: -14vmax; animation-duration: 34s; }

@keyframes drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(6vmax, 4vmax, 0) scale(1.15); }
}

/* ── Общее ────────────────────────────────────────────────────────────── */

.muted { color: var(--muted); }
.error { color: var(--lose); }

.card {
  background: var(--card);
  border: 1px solid var(--card-line);
  border-radius: var(--radius);
  padding: 20px;
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 12px 22px;
  border: 0; border-radius: 12px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff; font: inherit; font-weight: 600;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.2s ease, filter 0.2s ease;
  box-shadow: 0 10px 26px rgba(88, 101, 242, 0.35);
}
.btn:hover:not(:disabled) { transform: translateY(-2px); filter: brightness(1.08); }
.btn:active:not(:disabled) { transform: translateY(0) scale(0.98); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; box-shadow: none; }

.btn-ghost {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--card-line);
  box-shadow: none;
}
.btn-cash { background: linear-gradient(135deg, #17c964, #0f9b4c); box-shadow: 0 10px 26px rgba(23, 201, 100, 0.32); }

input[type="number"], input[type="text"], select {
  padding: 11px 14px;
  border-radius: 12px;
  border: 1px solid var(--card-line);
  background: rgba(0, 0, 0, 0.28);
  color: var(--ink);
  font: inherit;
  min-width: 0;
}
input:focus, select:focus { outline: 2px solid var(--brand); outline-offset: 1px; }

/* ── Вход ─────────────────────────────────────────────────────────────── */

/* Любой display в авторских стилях сильнее браузерного [hidden]{display:none},
   поэтому спрятанные секции (.gate, .picker) приходится гасить явно. */
[hidden] { display: none !important; }

.gate { min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.gate-card {
  width: min(430px, 100%);
  text-align: center;
  background: var(--card);
  border: 1px solid var(--card-line);
  border-radius: 26px;
  padding: 42px 32px;
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
  animation: rise 0.5s cubic-bezier(0.2, 0.9, 0.3, 1) both;
}
.gate-card h1 { margin: 12px 0 8px; font-size: 27px; }
.gate-logo { font-size: 56px; animation: bob 3.4s ease-in-out infinite; }
.btn-discord { width: 100%; margin-top: 22px; text-decoration: none; }

@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(-4deg); } 50% { transform: translateY(-9px) rotate(4deg); } }

.guild-list { display: grid; gap: 10px; margin-top: 20px; }
.guild {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--card-line);
  background: rgba(255, 255, 255, 0.05);
  color: var(--ink); font: inherit; text-align: left;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.2s ease;
}
.guild:hover { transform: translateX(4px); background: rgba(255, 255, 255, 0.1); }
.guild img, .guild .fallback {
  width: 38px; height: 38px; border-radius: 12px; object-fit: cover;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  font-weight: 700;
}

/* ── Шапка ────────────────────────────────────────────────────────────── */

.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 14px;
  padding: 14px clamp(14px, 4vw, 34px);
  background: rgba(11, 13, 23, 0.72);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--card-line);
}
.brand { font-size: 19px; font-weight: 800; cursor: pointer; letter-spacing: 0.3px; }
.brand span { background: linear-gradient(120deg, var(--brand), var(--brand-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }

.wallet { margin-left: auto; text-align: right; line-height: 1.15; }
.wallet-label { display: block; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }
.wallet-sum { font-size: 20px; font-variant-numeric: tabular-nums; color: var(--gold); }
.wallet-sum.bump { animation: bump 0.45s cubic-bezier(0.3, 1.6, 0.4, 1); }
@keyframes bump { 50% { transform: scale(1.22); text-shadow: 0 0 22px rgba(255, 200, 74, 0.65); } }

.me {
  display: flex; align-items: center; gap: 9px;
  padding: 6px 12px 6px 6px;
  border-radius: 999px;
  border: 1px solid var(--card-line);
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink); font: inherit; cursor: pointer;
}
.me img { border-radius: 50%; background: #222; }

.menu {
  position: absolute; top: 62px; right: 18px;
  display: grid; gap: 2px;
  min-width: 200px; padding: 8px;
  border-radius: 14px;
  border: 1px solid var(--card-line);
  background: #171a2e;
  box-shadow: var(--shadow);
  animation: rise 0.16s ease both;
}
.menu button, .menu a {
  padding: 10px 12px; border: 0; border-radius: 10px;
  background: none; color: var(--ink); font: inherit; text-align: left;
  text-decoration: none; cursor: pointer;
}
.menu button:hover, .menu a:hover { background: rgba(255, 255, 255, 0.08); }
.menu-guild { padding: 8px 12px; font-size: 12px; color: var(--muted); border-bottom: 1px solid var(--card-line); margin-bottom: 4px; }

/* ── Вкладки ──────────────────────────────────────────────────────────── */

.tabs {
  display: flex; gap: 8px;
  padding: 12px clamp(14px, 4vw, 34px);
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: 0 0 auto;
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid var(--card-line);
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted); font: inherit; font-weight: 600;
  cursor: pointer;
  transition: color 0.2s, background 0.2s, transform 0.12s;
}
.tab:hover { color: var(--ink); transform: translateY(-1px); }
.tab.is-active { color: #fff; background: linear-gradient(135deg, var(--brand), var(--brand-2)); border-color: transparent; }

/* ── Экраны ───────────────────────────────────────────────────────────── */

.screen { padding: 8px clamp(14px, 4vw, 34px) 60px; max-width: 1100px; margin: 0 auto; }
.screen > * { animation: rise 0.32s cubic-bezier(0.2, 0.9, 0.3, 1) both; }

h2 { margin: 6px 0 16px; font-size: 22px; }
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }

.game-card {
  display: grid; gap: 6px;
  padding: 22px;
  border-radius: var(--radius);
  border: 1px solid var(--card-line);
  background: var(--card);
  cursor: pointer; color: inherit; font: inherit; text-align: left;
  transition: transform 0.16s ease, border-color 0.2s, box-shadow 0.2s;
}
.game-card:hover { transform: translateY(-5px); border-color: rgba(155, 92, 255, 0.55); box-shadow: var(--shadow); }
.game-card .ico { font-size: 34px; }
.game-card b { font-size: 17px; }

/* Панель ставки — одинаковая во всех играх */
.betbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 18px; }
.betbar input { width: 150px; }
.chip {
  padding: 8px 13px; border-radius: 10px;
  border: 1px solid var(--card-line); background: rgba(255, 255, 255, 0.05);
  color: var(--muted); font: inherit; cursor: pointer;
}
.chip:hover { color: var(--ink); background: rgba(255, 255, 255, 0.1); }
.chip.is-on { color: #fff; background: linear-gradient(135deg, var(--brand), var(--brand-2)); border-color: transparent; }

.stage { display: grid; place-items: center; gap: 18px; padding: 26px; min-height: 260px; }
.verdict { font-size: 19px; font-weight: 700; min-height: 28px; text-align: center; }
.verdict.win { color: var(--win); animation: pop 0.4s cubic-bezier(0.3, 1.7, 0.4, 1); }
.verdict.lose { color: var(--lose); animation: shake 0.4s; }
@keyframes pop { from { transform: scale(0.6); opacity: 0; } }
@keyframes shake { 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }

/* ── Слоты ────────────────────────────────────────────────────────────── */

.reels { display: flex; gap: 14px; }
.reel {
  width: 104px; height: 128px;
  border-radius: 16px;
  border: 1px solid var(--card-line);
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.5), rgba(255, 255, 255, 0.05));
  overflow: hidden;
  box-shadow: inset 0 12px 24px rgba(0, 0, 0, 0.55);
}
.reel-strip { display: grid; }
.reel-strip span { height: 128px; display: grid; place-items: center; font-size: 52px; }
.reel.spin .reel-strip { animation: roll 0.6s linear infinite; }
@keyframes roll { from { transform: translateY(0); } to { transform: translateY(-128px); } }
.reel.hit { border-color: var(--gold); box-shadow: 0 0 30px rgba(255, 200, 74, 0.5); }

/* ── Рулетка ──────────────────────────────────────────────────────────── */

.wheel-wrap { position: relative; display: grid; place-items: center; }
.wheel {
  width: 230px; height: 230px; border-radius: 50%;
  border: 8px solid rgba(255, 255, 255, 0.1);
  display: grid; place-items: center;
  font-size: 46px; font-weight: 800;
  background: conic-gradient(#1f2340 0 25%, #b3243a 0 50%, #1f2340 0 75%, #b3243a 0);
  transition: transform 3.4s cubic-bezier(0.15, 0.9, 0.2, 1);
  box-shadow: inset 0 0 44px rgba(0, 0, 0, 0.65), var(--shadow);
}
.wheel-face {
  position: absolute; width: 108px; height: 108px; border-radius: 50%;
  display: grid; place-items: center;
  background: #0e1122; border: 2px solid var(--card-line);
  font-size: 38px; font-variant-numeric: tabular-nums;
}
.wheel-face.red { color: #ff6274; } .wheel-face.black { color: #cfd4ff; } .wheel-face.zero { color: var(--win); }
.bet-grid { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); width: 100%; }

/* ── Кости ────────────────────────────────────────────────────────────── */

.dice-pair { display: flex; gap: 20px; }
.die {
  width: 92px; height: 92px; border-radius: 18px;
  background: linear-gradient(160deg, #fff, #c9cde8);
  color: #10132a;
  display: grid; place-items: center; font-size: 54px;
  box-shadow: var(--shadow);
}
.die.roll { animation: tumble 0.55s ease-in-out; }
@keyframes tumble { 50% { transform: rotate(200deg) scale(0.85); } to { transform: rotate(360deg); } }

/* ── Мины ─────────────────────────────────────────────────────────────── */

.mine-field { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; width: min(360px, 100%); }
.cell {
  aspect-ratio: 1;
  border-radius: 14px;
  border: 1px solid var(--card-line);
  background: rgba(255, 255, 255, 0.06);
  font-size: 27px; cursor: pointer;
  transition: transform 0.12s, background 0.25s;
}
.cell:hover:not(:disabled) { transform: translateY(-3px); background: rgba(255, 255, 255, 0.12); }
.cell.gem { background: rgba(61, 220, 132, 0.16); border-color: var(--win); animation: pop 0.3s; }
.cell.boom { background: rgba(255, 92, 114, 0.22); border-color: var(--lose); animation: shake 0.4s; }
.cell:disabled { cursor: default; }

/* ── Краш ─────────────────────────────────────────────────────────────── */

.crash-box { position: relative; width: 100%; height: 260px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--card-line); background: rgba(0, 0, 0, 0.32); }
.crash-box svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.crash-mult {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  font-size: 58px; font-weight: 800; font-variant-numeric: tabular-nums;
  text-shadow: 0 6px 30px rgba(0, 0, 0, 0.6);
}
.crash-mult.boom { color: var(--lose); animation: shake 0.45s; }
.crash-mult.saved { color: var(--win); animation: pop 0.4s; }

/* ── Карты ────────────────────────────────────────────────────────────── */

.hand { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.pcard {
  width: 82px; height: 116px;
  border-radius: 12px;
  background: linear-gradient(165deg, #fff, #dfe3f7);
  color: #12142c;
  display: grid; place-items: center;
  font-size: 25px; font-weight: 700;
  box-shadow: var(--shadow);
  animation: deal 0.36s cubic-bezier(0.2, 0.9, 0.3, 1) both;
  cursor: pointer;
  transition: transform 0.14s, box-shadow 0.2s;
  border: 2px solid transparent;
}
.pcard.red { color: #cc2340; }
.pcard.back { background: repeating-linear-gradient(45deg, #2b3168, #2b3168 7px, #3a418a 7px, #3a418a 14px); color: transparent; }
.pcard.held { border-color: var(--lose); transform: translateY(8px); opacity: 0.65; }
.pcard:hover { transform: translateY(-6px); }
@keyframes deal { from { opacity: 0; transform: translateY(-40px) rotate(-12deg); } }
.hand-label { text-align: center; color: var(--muted); margin-bottom: 6px; }

/* ── Биржа и профиль ──────────────────────────────────────────────────── */

.mood { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.mood-emoji { font-size: 40px; }

.rows { display: grid; gap: 10px; }
.row {
  display: grid; gap: 4px 14px;
  grid-template-columns: 1fr auto;
  align-items: center;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--card-line);
  background: var(--card);
}
.row .sub { grid-column: 1 / -1; font-size: 13px; color: var(--muted); }
.spark { font-family: monospace; letter-spacing: 1px; color: var(--muted); }
.up { color: var(--win); } .down { color: var(--lose); }
.num { font-variant-numeric: tabular-nums; }
.row-actions { display: flex; gap: 8px; align-items: center; }
.row-actions input { width: 92px; }

.stat-row { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin-bottom: 20px; }
.stat { padding: 16px; border-radius: 14px; border: 1px solid var(--card-line); background: var(--card); }
.stat b { display: block; font-size: 21px; font-variant-numeric: tabular-nums; }
.stat span { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.8px; }

.bar { height: 8px; border-radius: 99px; background: rgba(255, 255, 255, 0.09); overflow: hidden; margin-top: 8px; }
.bar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--brand), var(--brand-2)); transition: width 0.5s ease; }

/* ── Уведомления ──────────────────────────────────────────────────────── */

.toasts { position: fixed; right: 16px; bottom: 16px; display: grid; gap: 10px; z-index: 60; }
.toast {
  padding: 13px 18px;
  border-radius: 13px;
  border: 1px solid var(--card-line);
  background: #171a2e;
  box-shadow: var(--shadow);
  animation: rise 0.25s ease both;
  max-width: 340px;
}
.toast.win { border-color: var(--win); }
.toast.lose { border-color: var(--lose); }

@media (max-width: 620px) {
  .wallet-sum { font-size: 17px; }
  .me span { display: none; }
  .reel { width: 84px; height: 106px; }
  .reel-strip span { height: 106px; font-size: 42px; }
  @keyframes roll { to { transform: translateY(-106px); } }
}

/* Уважаем системную настройку: кому анимации мешают — тот их не увидит */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
