/* ===== Мурказино — тема «Ночной неон» ===== */

:root {
  --bg: #0f0b1a;
  --bg-2: #120d20;
  --card: #1a1430;
  --card-2: #221a3d;
  --line: #2e2552;
  --text: #ede9fe;
  --muted: #9a8fc0;
  --cyan: #22d3ee;
  --pink: #f472b6;
  --violet: #a78bfa;
  --gold: #fbbf24;
  --green: #34d399;
  --red: #fb7185;
  --radius: 18px;
  --glow-cyan: 0 0 10px rgba(34, 211, 238, .55), 0 0 28px rgba(34, 211, 238, .22);
  --glow-pink: 0 0 10px rgba(244, 114, 182, .6), 0 0 28px rgba(244, 114, 182, .25);
  --font: 'Nunito', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --display: 'Unbounded', 'Nunito', system-ui, sans-serif;
  --tabbar-h: 64px;
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.4;
  min-height: 100vh;
  overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
button:disabled { cursor: default; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { margin: 0; }
.muted { color: var(--muted); }
.mono { font-variant-numeric: tabular-nums; }
.pos { color: var(--green); }
.neg { color: var(--red); }
[hidden] { display: none !important; }

/* звёздное небо */
.sky {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(1px 1px at 12% 18%, #fff8, transparent 60%),
    radial-gradient(1px 1px at 72% 9%, #fff9, transparent 60%),
    radial-gradient(1.5px 1.5px at 38% 42%, #fff6, transparent 60%),
    radial-gradient(1px 1px at 88% 36%, #fff7, transparent 60%),
    radial-gradient(1px 1px at 22% 70%, #fff5, transparent 60%),
    radial-gradient(1.5px 1.5px at 62% 82%, #fff6, transparent 60%),
    radial-gradient(1px 1px at 92% 74%, #fff5, transparent 60%),
    radial-gradient(1px 1px at 5% 92%, #fff5, transparent 60%),
    radial-gradient(600px 380px at 85% -10%, rgba(244, 114, 182, .14), transparent 70%),
    radial-gradient(520px 420px at -10% 30%, rgba(34, 211, 238, .10), transparent 70%),
    var(--bg);
  animation: twinkle 6s ease-in-out infinite alternate;
}
@keyframes twinkle { from { opacity: .85; } to { opacity: 1; } }

#app { max-width: 560px; margin: 0 auto; }

.fish { width: 1.35em; height: .85em; vertical-align: -.08em; margin-left: .2em; flex: none; }
.cookies { white-space: nowrap; font-weight: 800; }

/* ===== шапка ===== */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 16px;
  background: rgba(15, 11, 26, .82);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(46, 37, 82, .7);
}
.me { display: flex; align-items: center; gap: 10px; min-width: 0; }
.me-text { display: flex; flex-direction: column; min-width: 0; }
.me-name { font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 40vw; }
.me-level { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 46vw; }
.balance {
  display: flex; align-items: center; gap: 2px;
  padding: 7px 12px 7px 14px; border-radius: 999px;
  background: linear-gradient(180deg, #2a1f4a, #1d1636);
  border: 1px solid rgba(251, 191, 36, .45);
  box-shadow: 0 0 14px rgba(251, 191, 36, .18);
  font-weight: 900; color: var(--gold); font-variant-numeric: tabular-nums;
  flex-direction: row-reverse;
}
.balance .fish { width: 26px; height: 16px; margin: 0 0 0 4px; }
.balance.bump { animation: bump .5s ease; }
@keyframes bump { 30% { transform: scale(1.1); box-shadow: 0 0 22px rgba(251, 191, 36, .55); } }

.avatar {
  width: 38px; height: 38px; border-radius: 50%; flex: none; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--violet), var(--pink));
  font-weight: 900; color: #1a0f33;
  box-shadow: 0 0 0 2px rgba(34, 211, 238, .5);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.sm { width: 30px; height: 30px; font-size: 13px; box-shadow: none; }
.avatar.lg { width: 56px; height: 56px; font-size: 22px; }
.avatar.xl { width: 84px; height: 84px; font-size: 34px; box-shadow: 0 0 0 3px var(--cyan), var(--glow-cyan); }

/* ===== основной вид и нижнее меню ===== */
.view { padding: 14px 16px calc(var(--tabbar-h) + 28px + env(safe-area-inset-bottom)); min-height: 70vh; }
body:not(.ready) .view { opacity: 0; }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: flex; justify-content: center;
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  background: rgba(18, 13, 32, .92);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid rgba(46, 37, 82, .8);
}
.tabbar a {
  flex: 1; max-width: 140px;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 6px 4px; border-radius: 14px;
  font-size: 11px; font-weight: 800; color: var(--muted);
  transition: color .2s, background .2s;
}
.tabbar .ti { font-size: 21px; filter: grayscale(.6); transition: filter .2s, transform .2s; }
.tabbar a.active { color: var(--cyan); background: rgba(34, 211, 238, .08); }
.tabbar a.active .ti { filter: none; transform: translateY(-1px); }

/* ===== общие элементы ===== */
.section-title { font-family: var(--display); font-size: 15px; font-weight: 600; margin: 22px 2px 10px; letter-spacing: .02em; }
.page-head { margin: 4px 2px 14px; }
.page-head h1, .game-head h1 { font-family: var(--display); font-size: 21px; font-weight: 800; }
.page-head p { margin: 4px 0 0; }
.game-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; margin: 2px 2px 12px; }
.game-rules { font-size: 12px; color: var(--muted); }
.footnote { font-size: 12px; color: var(--muted); text-align: center; margin: 18px 8px 0; }
.empty { padding: 26px 12px; text-align: center; color: var(--muted); }

.card, .panel {
  background: linear-gradient(180deg, var(--card), #171129);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 12px;
}
.panel { margin-top: 12px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 11px 16px; border-radius: 14px;
  font-weight: 900; letter-spacing: .01em;
  transition: transform .12s, box-shadow .2s, opacity .2s, background .2s;
  user-select: none;
}
.btn:active:not(:disabled) { transform: scale(.97); }
.btn:disabled { opacity: .45; }
.btn-primary {
  background: linear-gradient(135deg, #22d3ee, #818cf8 55%, #f472b6);
  color: #120a24;
  box-shadow: var(--glow-cyan);
}
.btn-ghost { background: var(--card-2); border: 1px solid var(--line); color: var(--text); }
.btn-danger { background: rgba(251, 113, 133, .15); border: 1px solid rgba(251, 113, 133, .5); color: var(--red); }
.btn-big { width: 100%; padding: 15px 16px; font-size: 16px; margin-top: 12px; border-radius: 16px; }
.btn-xs { padding: 5px 9px; font-size: 12px; border-radius: 10px; }
.btn-cashout {
  background: linear-gradient(135deg, #fbbf24, #f472b6);
  color: #2a0a1a; box-shadow: var(--glow-pink);
  animation: pulse 1s ease-in-out infinite;
}
@keyframes pulse { 50% { box-shadow: 0 0 18px rgba(244, 114, 182, .9), 0 0 40px rgba(251, 191, 36, .35); } }
.icon-btn { width: 32px; height: 32px; border-radius: 10px; background: var(--card-2); color: var(--muted); flex: none; }
.link { color: var(--cyan); font-weight: 700; text-align: left; }

input[type="text"], input[type="search"], select, textarea {
  width: 100%; background: #120d22; border: 1px solid var(--line); border-radius: 12px;
  padding: 10px 12px; outline: none; transition: border-color .2s, box-shadow .2s;
}
input:focus, select:focus, textarea:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(34, 211, 238, .15); }
textarea { resize: vertical; min-height: 110px; }
.field-label { display: block; font-size: 12px; font-weight: 800; color: var(--muted); margin: 10px 2px 6px; text-transform: uppercase; letter-spacing: .06em; }

.segmented { display: flex; gap: 4px; padding: 4px; background: #120d22; border: 1px solid var(--line); border-radius: 14px; }
.segmented button { flex: 1; padding: 9px 6px; border-radius: 10px; font-weight: 800; font-size: 13px; color: var(--muted); transition: all .2s; }
.segmented button.active { background: var(--card-2); color: var(--cyan); box-shadow: inset 0 0 0 1px rgba(34, 211, 238, .45); }
.segmented.small button { padding: 6px 8px; font-size: 12px; }

input[type="range"] { width: 100%; accent-color: var(--cyan); }

/* ===== всплывашки и модалки ===== */
#toasts { position: fixed; top: 64px; left: 0; right: 0; z-index: 60; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; padding: 0 16px; }
.toast {
  max-width: 420px; padding: 11px 16px; border-radius: 14px;
  background: rgba(34, 26, 61, .96); border: 1px solid var(--line);
  font-weight: 800; box-shadow: 0 8px 30px rgba(0, 0, 0, .45);
  opacity: 0; transform: translateY(-10px) scale(.98); transition: all .25s ease;
}
.toast.show { opacity: 1; transform: none; }
.toast-win { border-color: rgba(52, 211, 153, .6); box-shadow: 0 0 22px rgba(52, 211, 153, .25); }
.toast-lose { border-color: rgba(244, 114, 182, .5); }
.toast-error { border-color: rgba(251, 113, 133, .7); color: #fecdd3; }

.modal-wrap {
  position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center;
  background: rgba(5, 3, 12, .65); opacity: 0; transition: opacity .25s;
}
.modal-wrap.show { opacity: 1; }
.modal {
  width: 100%; max-width: 560px; max-height: 88vh; overflow: auto;
  background: var(--bg-2); border: 1px solid var(--line); border-bottom: 0;
  border-radius: 24px 24px 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom));
  transform: translateY(30px); transition: transform .25s ease;
}
.modal-wrap.show .modal { transform: none; }

.levelup { text-align: center; padding: 8px 4px; }
.levelup-icon { font-size: 64px; animation: float 2s ease-in-out infinite; filter: drop-shadow(0 0 18px rgba(251, 191, 36, .5)); }
.levelup-kicker { color: var(--cyan); font-weight: 900; text-transform: uppercase; letter-spacing: .1em; font-size: 12px; margin-top: 6px; }
.levelup h2 { font-family: var(--display); font-size: 24px; margin: 6px 0; }
.levelup .btn { margin-top: 14px; min-width: 160px; }
@keyframes float { 50% { transform: translateY(-8px); } }

.fatal { min-height: 90vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 24px; }
.fatal-cat { font-size: 72px; }
.fatal h1 { font-family: var(--display); font-size: 22px; margin: 12px 0 6px; }
.fatal p { color: var(--muted); max-width: 320px; }

/* ===== главная ===== */
.hero { text-align: center; padding: 10px 0 6px; }
.hero-moon { font-size: 30px; display: block; filter: drop-shadow(0 0 14px rgba(251, 191, 36, .6)); }
.neon-title {
  font-family: var(--display); font-weight: 800; font-size: clamp(30px, 9vw, 40px); letter-spacing: .02em;
  color: #fdf4ff;
  text-shadow: 0 0 6px rgba(244, 114, 182, .9), 0 0 18px rgba(244, 114, 182, .6), 0 0 40px rgba(34, 211, 238, .35);
  animation: flicker 5s infinite;
}
@keyframes flicker { 0%, 92%, 96%, 100% { opacity: 1; } 94% { opacity: .55; } }
.hero p { margin: 4px 0 0; color: var(--muted); }

.daily {
  width: 100%; display: flex; align-items: center; gap: 12px; text-align: left;
  margin-top: 16px; padding: 14px; border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(251, 191, 36, .14), rgba(244, 114, 182, .10));
  border: 1px solid rgba(251, 191, 36, .35);
}
.daily.wait { background: var(--card); border-color: var(--line); }
.daily-icon { display: flex; }
.daily-icon .fish { width: 48px; height: 30px; margin: 0; filter: drop-shadow(0 0 10px rgba(251, 191, 36, .45)); }
.daily.ready .daily-icon { animation: float 1.6s ease-in-out infinite; }
.daily-text { display: flex; flex-direction: column; flex: 1; }
.daily-text span { color: var(--muted); font-size: 13px; }
.daily-cta { padding: 8px 14px; border-radius: 12px; background: var(--gold); color: #2a1503; font-weight: 900; box-shadow: 0 0 16px rgba(251, 191, 36, .4); }

.game-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.game-card {
  position: relative; display: flex; flex-direction: column; gap: 3px;
  padding: 14px; border-radius: var(--radius); min-height: 168px;
  background: linear-gradient(160deg, var(--card-2), var(--card) 60%);
  border: 1px solid var(--line);
  overflow: hidden; transition: transform .15s;
}
.game-card:active { transform: scale(.97); }
.game-card::before {
  content: ''; position: absolute; inset: auto -30% -40% auto; width: 140px; height: 140px; border-radius: 50%;
  background: var(--tone); opacity: .22; filter: blur(30px);
}
.tone-cyan { --tone: var(--cyan); border-color: rgba(34, 211, 238, .4); }
.tone-pink { --tone: var(--pink); border-color: rgba(244, 114, 182, .4); }
.tone-violet { --tone: var(--violet); border-color: rgba(167, 139, 250, .4); }
.tone-gold { --tone: var(--gold); border-color: rgba(251, 191, 36, .4); }
.game-art { position: relative; height: 82px; display: flex; align-items: center; }
.game-icon { font-size: 54px; filter: drop-shadow(0 0 14px var(--tone)); }
.game-cat { position: absolute; left: 48px; bottom: 6px; font-size: 26px; }
.game-name { font-family: var(--display); font-weight: 800; font-size: 15px; margin-top: auto; }
.game-sub { font-size: 12px; color: var(--muted); }
.game-card.off { opacity: .45; filter: grayscale(.7); }
.live-dot {
  position: absolute; top: 10px; right: 10px; font-size: 10px; font-weight: 900; text-transform: uppercase; letter-spacing: .06em;
  color: var(--green); display: flex; align-items: center; gap: 5px;
}
.live-dot::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px var(--green); animation: blink 1.4s infinite; }
@keyframes blink { 50% { opacity: .3; } }

/* ===== поле ставки ===== */
.bet-row { display: flex; gap: 8px; }
.bet-step { width: 52px; border-radius: 12px; background: var(--card-2); border: 1px solid var(--line); font-weight: 900; color: var(--cyan); }
.bet-field { flex: 1; display: flex; align-items: center; gap: 6px; background: #120d22; border: 1px solid var(--line); border-radius: 12px; padding: 0 12px; }
.bet-field:focus-within { border-color: var(--cyan); }
.bet-field .fish { width: 26px; height: 16px; margin: 0; }
.bet-field input { border: 0; background: none; padding: 11px 0; font-weight: 900; font-size: 18px; box-shadow: none !important; font-variant-numeric: tabular-nums; }
.bet-quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 8px; }
.bet-quick button { padding: 7px 0; border-radius: 10px; background: #120d22; border: 1px solid var(--line); font-size: 12px; font-weight: 800; color: var(--muted); }
.bet-quick button:active { color: var(--cyan); }

/* ===== рулетка ===== */
.wheel-wrap { position: relative; width: min(76vw, 300px); aspect-ratio: 1; margin: 6px auto 10px; }
.wheel { width: 100%; height: 100%; border-radius: 50%; box-shadow: var(--glow-cyan); }
.wheel-pointer {
  position: absolute; top: -6px; left: 50%; z-index: 2; transform: translateX(-50%);
  width: 0; height: 0; border-left: 12px solid transparent; border-right: 12px solid transparent; border-top: 22px solid var(--gold);
  filter: drop-shadow(0 0 8px rgba(251, 191, 36, .9));
}
.wheel-hub {
  position: absolute; inset: 31%; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  pointer-events: none;
}
.wheel-result {
  width: 64%; aspect-ratio: 1; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-family: var(--display); font-weight: 800; font-size: 26px; background: #120d22; border: 2px solid var(--line);
}
.wheel-result.red { background: #e0245e; border-color: #fda4af; box-shadow: 0 0 20px rgba(224, 36, 94, .7); }
.wheel-result.black { background: #221b3d; border-color: var(--violet); box-shadow: 0 0 20px rgba(167, 139, 250, .5); }
.wheel-result.zero { background: var(--gold); color: #3b1d06; box-shadow: 0 0 20px rgba(251, 191, 36, .7); }
.wheel-result.pop { animation: pop .45s ease; }
@keyframes pop { 0% { transform: scale(.6); } 70% { transform: scale(1.12); } }

.recent { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 10px; scrollbar-width: none; min-height: 40px; align-items: center; }
.recent::-webkit-scrollbar { display: none; }
.recent .muted { font-size: 12px; }
.ball { flex: none; width: 30px; height: 30px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 900; font-size: 13px; }
.ball.red { background: #e0245e; }
.ball.black { background: #2a2150; border: 1px solid var(--violet); }
.ball.zero { background: var(--gold); color: #3b1d06; }

.chip-row { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 12px; scrollbar-width: none; }
.chip-row::-webkit-scrollbar { display: none; }
.chip {
  flex: none; width: 46px; height: 46px; border-radius: 50%; font-weight: 900; font-size: 13px;
  border: 3px dashed rgba(255, 255, 255, .55); color: #120a24; transition: transform .15s, box-shadow .15s;
}
.chip-0 { background: #a5f3fc; } .chip-1 { background: #22d3ee; } .chip-2 { background: #a78bfa; }
.chip-3 { background: #f472b6; } .chip-4 { background: #fbbf24; } .chip-5 { background: #34d399; } .chip-6 { background: #fb7185; }
.chip.active { transform: translateY(-4px) scale(1.06); box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px #fff, 0 6px 16px rgba(0, 0, 0, .4); }

.rt-table { display: flex; flex-direction: column; gap: 4px; user-select: none; }
.rt-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.rt-row3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.rt-row6 { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; }
.rt-cell {
  position: relative; height: 36px; border-radius: 8px; font-weight: 900; font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid transparent; transition: transform .1s, box-shadow .2s;
}
.rt-cell:active { transform: scale(.95); }
.rt-cell.red { background: linear-gradient(180deg, #e0245e, #b81b4c); }
.rt-cell.black { background: linear-gradient(180deg, #2a2150, #1e1838); border-color: #3a2f66; }
.rt-cell.zero { background: linear-gradient(180deg, #fbbf24, #d97706); color: #3b1d06; height: 40px; }
.rt-cell.zero .fish { width: 24px; height: 15px; }
.rt-cell.out { background: var(--card-2); border-color: var(--line); font-size: 12px; color: var(--text); }
.rt-cell.hit { box-shadow: 0 0 0 2px #fff, 0 0 18px rgba(255, 255, 255, .7); z-index: 1; animation: pop .45s ease; }
.diamond { width: 14px; height: 14px; transform: rotate(45deg); border-radius: 2px; display: block; }
.diamond.red { background: #e0245e; }
.diamond.black { background: #120d22; border: 1px solid var(--violet); }
.chip-badge {
  position: absolute; top: -6px; right: -4px; z-index: 2; min-width: 24px; height: 22px; padding: 0 5px;
  display: flex; align-items: center; justify-content: center; border-radius: 11px;
  background: var(--gold); color: #2a1503; font-size: 11px; font-weight: 900;
  border: 2px dashed rgba(255, 255, 255, .7); box-shadow: 0 2px 6px rgba(0, 0, 0, .5);
}
.rt-actions { display: grid; grid-template-columns: 1.3fr 1.2fr .7fr; gap: 8px; margin-top: 12px; }
.rt-actions .btn { padding: 10px 6px; font-size: 13px; }
.spinning .rt-table, .spinning .rt-actions { opacity: .6; pointer-events: none; }

/* ===== ракетка ===== */
.history-strip { display: flex; gap: 6px; overflow-x: auto; padding: 0 0 10px; scrollbar-width: none; min-height: 34px; }
.history-strip::-webkit-scrollbar { display: none; }
.hchip { flex: none; padding: 4px 9px; border-radius: 999px; font-size: 12px; font-weight: 900; font-variant-numeric: tabular-nums; background: var(--card-2); }
.hchip.low { color: var(--pink); }
.hchip.mid { color: var(--cyan); }
.hchip.high { color: var(--gold); box-shadow: inset 0 0 0 1px rgba(251, 191, 36, .5); }

.crash-stage {
  position: relative; height: 250px; border-radius: var(--radius); overflow: hidden;
  background:
    radial-gradient(300px 200px at 80% 10%, rgba(244, 114, 182, .12), transparent 70%),
    linear-gradient(180deg, #160f2b, #0f0b1a);
  border: 1px solid var(--line);
}
#cr-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.crash-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; text-align: center; }
.big-mult { font-family: var(--display); font-weight: 800; font-size: 46px; font-variant-numeric: tabular-nums; }
.crash-center.flying .big-mult { color: #fff; text-shadow: var(--glow-cyan); }
.crash-center.crashed .big-mult { color: var(--pink); text-shadow: var(--glow-pink); }
.crash-label { font-weight: 900; color: var(--pink); margin-top: 2px; }
.wait-cat { font-size: 44px; animation: float 1.4s ease-in-out infinite; }
.wait-text { font-weight: 800; color: var(--muted); margin: 6px 0 10px; }
.wait-text b { color: var(--text); font-variant-numeric: tabular-nums; }
.wait-bar { width: 60%; height: 6px; border-radius: 3px; background: #2a2150; overflow: hidden; }
.wait-bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--cyan), var(--pink)); box-shadow: var(--glow-cyan); }

.auto-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 4px; }
.auto-row .field-label { margin: 10px 2px 0; }
.auto-field { display: flex; align-items: center; gap: 6px; width: 130px; margin-top: 8px; background: #120d22; border: 1px solid var(--line); border-radius: 12px; padding: 0 12px; }
.auto-field input { border: 0; background: none; padding: 9px 0; font-weight: 900; text-align: right; box-shadow: none !important; }
.auto-field span { color: var(--muted); font-weight: 900; }

.players { display: flex; flex-direction: column; gap: 6px; }
.player { display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); font-size: 14px; }
.player.me { border-color: rgba(34, 211, 238, .55); }
.player-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 700; }
.player-bet { font-weight: 800; white-space: nowrap; }
.player-state { min-width: 72px; text-align: right; font-weight: 900; font-size: 13px; }
.player-state .win { color: var(--green); }
.player-state .lose { color: var(--pink); }

/* ===== клубочек ===== */
.plinko-stage { position: relative; padding: 8px 4px 4px; border-radius: var(--radius); background: linear-gradient(180deg, #160f2b, #0f0b1a); border: 1px solid var(--line); }
#pl-canvas { display: block; width: 100%; }
.pl-recent { position: absolute; top: 10px; right: 10px; display: flex; flex-direction: column; gap: 4px; }
.pl-recent span {
  min-width: 46px; padding: 3px 6px; border-radius: 8px; text-align: center; font-size: 11px; font-weight: 900;
  background: color-mix(in srgb, var(--c) 22%, #120d22); color: var(--c); border: 1px solid color-mix(in srgb, var(--c) 50%, transparent);
}
.pl-recent span:first-child { animation: pop .4s ease; }

/* ===== 21 лапка ===== */
.bj-table {
  position: relative; padding: 16px 12px 18px; border-radius: 26px; min-height: 360px;
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(167, 139, 250, .18), transparent 60%),
    linear-gradient(180deg, #1c1438, #130e26);
  border: 2px solid rgba(34, 211, 238, .45); box-shadow: inset 0 0 40px rgba(34, 211, 238, .08), var(--glow-cyan);
  display: flex; flex-direction: column; gap: 12px;
}
.bj-who { display: flex; align-items: center; gap: 6px; font-weight: 800; color: var(--muted); justify-content: center; }
.bj-cat { font-size: 22px; }
.bj-score { display: inline-block; min-width: 30px; padding: 2px 8px; border-radius: 999px; background: #120d22; border: 1px solid var(--line); color: var(--text); font-weight: 900; font-size: 13px; text-align: center; }
.bj-score:empty { display: none; }
.bj-cards { display: flex; justify-content: center; min-height: 92px; padding: 8px 0; }
.bj-cards .pcard + .pcard { margin-left: -26px; }
.pcard {
  position: relative; width: 62px; height: 88px; border-radius: 10px; flex: none;
  background: linear-gradient(160deg, #fdfbff, #e9e3fb); color: #1a1430;
  box-shadow: 0 6px 14px rgba(0, 0, 0, .45);
  font-weight: 900;
}
.pcard.red { color: #db2777; }
.c-rank { position: absolute; top: 5px; left: 7px; font-size: 17px; line-height: 1; }
.c-suit { position: absolute; top: 23px; left: 8px; font-size: 13px; line-height: 1; }
.c-big { position: absolute; right: 7px; bottom: 4px; font-size: 30px; line-height: 1; opacity: .9; }
.pcard.back {
  background:
    repeating-linear-gradient(45deg, rgba(255, 255, 255, .06) 0 6px, transparent 6px 12px),
    linear-gradient(160deg, #7c3aed, #db2777);
  border: 2px solid rgba(255, 255, 255, .5);
  display: flex; align-items: center; justify-content: center; font-size: 26px;
}
.pcard.deal { animation: deal .32s cubic-bezier(.2, .8, .3, 1) both; }
@keyframes deal { from { opacity: 0; transform: translate(40px, -60px) rotate(12deg) scale(.8); } }
.bj-msg { text-align: center; font-weight: 900; font-size: 16px; min-height: 24px; }
.bj-msg.win { color: var(--green); text-shadow: 0 0 12px rgba(52, 211, 153, .5); }
.bj-msg.lose { color: var(--pink); }
.bj-msg.push { color: var(--gold); }
.bj-hands { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.bj-hand { padding: 4px 8px 8px; border-radius: 16px; border: 1px solid transparent; transition: border-color .2s, opacity .2s; }
.bj-hand.active { border-color: rgba(34, 211, 238, .6); background: rgba(34, 211, 238, .05); }
.bj-hand-info { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; font-size: 13px; }
.bj-hand-bet { color: var(--gold); font-weight: 800; }
.bj-res { font-weight: 900; }
.bj-res.win { color: var(--green); }
.bj-res.lose { color: var(--pink); }
.bj-res.push { color: var(--gold); }
.bj-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.btn-act { padding: 14px 8px; font-size: 15px; background: var(--card-2); border: 1px solid var(--line); }
.btn-act[data-act="hit"] { border-color: rgba(34, 211, 238, .6); color: var(--cyan); }
.btn-act[data-act="stand"] { border-color: rgba(244, 114, 182, .6); color: var(--pink); }
.btn-act[data-act="double"] { color: var(--gold); }
.btn-act[data-act="split"] { color: var(--violet); }
#bj-betbox .btn-big { margin-top: 12px; }

/* ===== топ ===== */
.my-rank { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: var(--radius); margin-bottom: 12px; background: linear-gradient(135deg, rgba(34, 211, 238, .12), rgba(244, 114, 182, .1)); border: 1px solid rgba(34, 211, 238, .35); }
.my-rank b { font-family: var(--display); font-size: 18px; color: var(--cyan); }
.my-rank .cookies { margin-left: auto; color: var(--gold); }
.leaderboard { display: flex; flex-direction: column; gap: 6px; }
.lb-row { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); }
.lb-row.podium { background: linear-gradient(90deg, rgba(251, 191, 36, .1), var(--card) 60%); }
.lb-row.me { border-color: rgba(34, 211, 238, .6); }
.lb-pos { width: 28px; text-align: center; font-weight: 900; color: var(--muted); font-size: 15px; }
.podium .lb-pos { font-size: 20px; }
.lb-name { flex: 1; min-width: 0; display: flex; flex-direction: column; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lb-name small { color: var(--muted); font-weight: 700; font-size: 11px; }
.lb-bal { font-weight: 900; color: var(--gold); white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ===== профиль ===== */
.profile-card { text-align: center; padding: 20px 16px; border-radius: var(--radius); background: linear-gradient(180deg, var(--card-2), var(--card)); border: 1px solid var(--line); }
.profile-name { font-family: var(--display); font-weight: 800; font-size: 19px; margin-top: 12px; }
.level-badge { display: inline-block; margin-top: 6px; padding: 4px 12px; border-radius: 999px; background: rgba(167, 139, 250, .15); color: var(--violet); font-weight: 900; font-size: 13px; }
.xp-bar { height: 10px; margin: 14px 0 6px; border-radius: 5px; background: #120d22; border: 1px solid var(--line); overflow: hidden; }
.xp-bar span { display: block; height: 100%; border-radius: 5px; background: linear-gradient(90deg, var(--cyan), var(--violet), var(--pink)); box-shadow: var(--glow-cyan); }
.xp-text { font-size: 13px; color: var(--muted); }
.xp-hint { font-size: 11px; color: var(--muted); opacity: .7; margin-top: 4px; }

.shop-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pack {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 16px 8px 12px;
  border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); transition: transform .15s;
}
.pack:active { transform: scale(.97); }
.pack.best { border-color: rgba(251, 191, 36, .6); box-shadow: 0 0 18px rgba(251, 191, 36, .15); }
.pack-tag { position: absolute; top: -9px; padding: 2px 10px; border-radius: 999px; background: var(--gold); color: #2a1503; font-size: 11px; font-weight: 900; }
.pack-cookies { font-weight: 900; font-size: 18px; color: var(--gold); }
.pack-price { padding: 6px 14px; border-radius: 10px; background: linear-gradient(135deg, #22d3ee, #818cf8); color: #120a24; font-weight: 900; font-size: 14px; }

.ref-card { padding: 14px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); }
.ref-card p { margin: 0 0 12px; color: var(--muted); font-size: 14px; }
.ref-link { display: flex; gap: 8px; margin-bottom: 10px; }
.ref-link input { font-size: 13px; color: var(--cyan); }
.ref-link .btn { padding: 10px 12px; font-size: 13px; }
.ref-card > .btn-primary { width: 100%; }
.ref-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.ref-stats div { display: flex; flex-direction: column; align-items: center; padding: 10px; border-radius: 12px; background: #120d22; }
.ref-stats b { font-size: 18px; font-weight: 900; }
.ref-stats span { font-size: 12px; color: var(--muted); }
.ref-list { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.ref-row { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.ref-row small { margin-left: auto; color: var(--muted); }

.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat { padding: 12px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; }
.stat span { font-size: 12px; color: var(--muted); }
.stat b { font-size: 17px; font-weight: 900; font-variant-numeric: tabular-nums; }

.history-list { display: flex; flex-direction: column; gap: 6px; }
.hist-row { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); font-size: 14px; }
.hist-game { display: flex; flex-direction: column; min-width: 0; font-weight: 800; }
.hist-game small { color: var(--muted); font-weight: 700; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hist-bet { font-size: 12px; color: var(--muted); white-space: nowrap; }
.hist-bet .fish { width: 1.2em; }
.hist-row b { min-width: 52px; text-align: right; font-variant-numeric: tabular-nums; }

.levels { margin-top: 14px; padding: 12px 14px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); }
.levels summary { font-weight: 800; cursor: pointer; }
.level-row { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; padding: 7px 0; font-size: 13px; border-bottom: 1px solid rgba(46, 37, 82, .6); }
.level-row:last-child { border-bottom: 0; }
.level-row span:last-child { min-width: 70px; text-align: right; color: var(--gold); font-weight: 800; }
.level-row.current { color: var(--cyan); font-weight: 900; }

/* ===== админка ===== */
.admin-tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 12px; scrollbar-width: none; }
.admin-tabs::-webkit-scrollbar { display: none; }
.admin-tabs button { flex: none; padding: 8px 14px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); font-weight: 800; font-size: 13px; color: var(--muted); }
.admin-tabs button.active { color: #120a24; background: var(--cyan); border-color: var(--cyan); box-shadow: var(--glow-cyan); }

.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.tile { padding: 12px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; }
.tile:last-child:nth-child(odd) { grid-column: span 2; }
.tile span { font-size: 12px; color: var(--muted); }
.tile b { font-size: 20px; font-weight: 900; font-variant-numeric: tabular-nums; }
.tile small { font-size: 11px; color: var(--muted); }

.chart-card { padding: 14px 10px 8px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); margin-bottom: 12px; }
.chart-title { font-weight: 800; padding: 0 4px 8px; }
.chart-wrap { position: relative; }
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart .grid { stroke: rgba(154, 143, 192, .14); stroke-width: 1; }
.chart .axis-zero { stroke: rgba(154, 143, 192, .45); stroke-width: 1; }
.chart .tick { fill: var(--muted); font-size: 10px; font-family: var(--font); }
.chart .bar-pos { fill: var(--cyan); }
.chart .bar-neg { fill: var(--pink); }
.chart .hit { fill: transparent; }
.chart .hit.on { fill: rgba(237, 233, 254, .06); }
.chart-tip {
  position: absolute; top: -6px; transform: translate(-50%, -100%); z-index: 3;
  display: flex; flex-direction: column; gap: 1px; padding: 8px 10px; border-radius: 10px;
  background: #241c42; border: 1px solid var(--line); font-size: 12px; white-space: nowrap; pointer-events: none;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .4);
}

.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { text-align: left; color: var(--muted); font-weight: 800; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; padding: 6px 4px; border-bottom: 1px solid var(--line); }
.table td { padding: 8px 4px; border-bottom: 1px solid rgba(46, 37, 82, .5); font-variant-numeric: tabular-nums; }
.table tr:last-child td { border-bottom: 0; }
.table td.num { text-align: right; }
.table.small { font-size: 12px; }
.table small { color: var(--muted); }
#bet-list, .card .table { overflow-x: auto; }

.search-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-bottom: 10px; }
.search-row select { width: auto; }
.user-list { display: flex; flex-direction: column; gap: 6px; }
.user-row { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); text-align: left; width: 100%; }
.user-row.banned { opacity: .55; }
.user-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.user-main b, .user-main small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-main small { color: var(--muted); font-size: 11px; }
.user-bal { font-weight: 900; color: var(--gold); white-space: nowrap; }

.user-modal { display: flex; flex-direction: column; gap: 12px; }
.um-head { display: flex; align-items: center; gap: 12px; }
.um-head > div { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.um-head small { color: var(--muted); font-size: 12px; }
.um-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.um-stats div { padding: 8px; border-radius: 12px; background: var(--card); display: flex; flex-direction: column; min-width: 0; }
.um-stats span { font-size: 11px; color: var(--muted); }
.um-stats b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.um-section { padding: 12px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); }
.um-section summary { font-weight: 800; cursor: pointer; }
.um-section p { margin: 0 0 8px; }
.um-section .field-label { margin-top: 0; }
.um-balance { display: grid; gap: 8px; }

.set-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.set-field { display: flex; flex-direction: column; gap: 4px; }
.set-field label { font-size: 12px; font-weight: 800; color: var(--muted); }
.set-field small { font-size: 11px; color: var(--muted); opacity: .8; }
.set-field.inline { flex-direction: row; align-items: center; justify-content: space-between; gap: 10px; }
.set-grid .set-field.inline { grid-column: span 2; }
.card-head .set-field label:empty { display: none; }

.switch { position: relative; display: inline-block; width: 46px; height: 26px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; border-radius: 13px; background: #2a2150; transition: background .2s; cursor: pointer; }
.switch span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--muted); transition: transform .2s, background .2s; }
.switch input:checked + span { background: rgba(34, 211, 238, .35); }
.switch input:checked + span::after { transform: translateX(20px); background: var(--cyan); box-shadow: var(--glow-cyan); }

.pack-row { display: grid; grid-template-columns: 1fr auto 1.3fr auto; align-items: center; gap: 8px; margin-bottom: 8px; }
.pack-row label { display: flex; align-items: center; gap: 6px; background: #120d22; border: 1px solid var(--line); border-radius: 12px; padding: 0 10px; }
.pack-row label .fish { margin: 0; width: 22px; height: 14px; }
.pack-row input { border: 0; background: none; padding: 9px 0; box-shadow: none !important; min-width: 0; }
.sticky-save { position: sticky; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); padding: 8px 0; background: linear-gradient(transparent, var(--bg) 40%); }
.check { display: flex; align-items: center; gap: 8px; margin: 10px 0 0; font-weight: 700; }
.check input { accent-color: var(--cyan); width: 18px; height: 18px; }

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