/* ============================================================
   werty :: components
   все переиспользуемые блоки: nav, кнопки, карточки, инпуты,
   статы, чипы, тосты, модалки, виджеты под игры
   ============================================================ */

/* ── Brand ────────────────────────────────────────────── */
.brand {
  display: flex; align-items: center; gap: var(--sp-3);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--fs-xl);
  letter-spacing: -.02em;
  padding: var(--sp-2) var(--sp-3);
}
.brand-dot {
  width: 32px; height: 32px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--p1), var(--p2));
  color: var(--bg);
  display: grid; place-items: center;
  font-size: 16px; font-weight: 800;
  box-shadow: var(--glow-p1);
}

/* ── Sidebar nav ──────────────────────────────────────── */
.nav-group {
  margin-top: var(--sp-5);
}
.nav-group-label {
  font-size: 10px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted-dim);
  padding: 0 var(--sp-3) var(--sp-2);
  font-weight: 600;
}
.nav-link {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: 10px var(--sp-3);
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-weight: 500;
  font-size: var(--fs-sm);
  cursor: pointer;
  user-select: none;
  border: 1px solid transparent;
  transition: background .18s, color .18s, border-color .18s;
}
.nav-link svg { width: 18px; height: 18px; flex-shrink: 0; }
.nav-link:hover { background: var(--surface-2); color: var(--ink); }
.nav-link.is-active {
  background: rgba(var(--p1-rgb), .14);
  color: var(--ink);
  border-color: rgba(var(--p1-rgb), .28);
}
.nav-link.is-active svg { color: var(--p1); }
.nav-link .badge {
  margin-left: auto;
  font-size: 9px; font-weight: 700; letter-spacing: .08em;
  padding: 2px 6px; border-radius: var(--radius-pill);
  background: var(--danger); color: #fff;
}
.nav-foot {
  margin-top: auto;
  padding: var(--sp-3);
  font-size: var(--fs-xs);
  color: var(--muted-dim);
  font-family: var(--font-mono);
  line-height: 1.6;
}

/* ── Topbar ───────────────────────────────────────────── */
.topbar-burger {
  display: none;
  appearance: none;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  width: 40px; height: 40px;
  color: var(--ink);
  cursor: pointer;
  align-items: center; justify-content: center;
  flex-shrink: 0;
}
.topbar-burger svg { width: 20px; height: 20px; }
@media (max-width: 1023px) {
  .topbar-burger { display: inline-flex; }
}

.crumbs {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--muted);
  letter-spacing: .04em;
}

/* ── Live winner ticker (sticky-бар под topbar) ───────── */
.live-ticker {
  display: flex; align-items: center; gap: var(--sp-3);
  background: linear-gradient(90deg, rgba(var(--p1-rgb), .14), rgba(var(--p2-rgb), .08));
  border-bottom: 1px solid var(--line);
  padding: 8px var(--sp-5);
  overflow: hidden;
  position: relative;
}
.live-ticker-tag {
  display: flex; align-items: center; gap: 6px;
  font-family: var(--font-mono);
  font-size: 10px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--success);
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
  padding-right: var(--sp-3);
  border-right: 1px solid var(--line);
}
.live-ticker-tag .live-dot {
  width: 6px; height: 6px; border-radius: 999px;
  background: var(--success);
  box-shadow: 0 0 8px var(--success);
  animation: pulse 1.4s ease-in-out infinite;
}
.live-ticker-inner {
  display: flex; gap: var(--sp-5);
  white-space: nowrap;
  animation: tickerScroll 60s linear infinite;
}
.live-ticker:hover .live-ticker-inner { animation-play-state: paused; }
@keyframes tickerScroll { 0% { transform: translateX(0) } 100% { transform: translateX(-50%) } }
.tw-item { font-family: var(--font-mono); font-size: var(--fs-sm); color: var(--muted); }
.tw-nick { color: var(--ink); font-weight: 600; }
.tw-game { color: var(--muted-dim); }
.tw-mult { color: var(--p1); font-weight: 700; }
.tw-won  { color: var(--success); font-weight: 700; }
@media (max-width: 575px) {
  .live-ticker { padding: 6px var(--sp-3); }
  .live-ticker-tag { font-size: 9px; padding-right: var(--sp-2); }
  .tw-item { font-size: var(--fs-xs); }
}

/* ── Bell (топбар) ────────────────────────────────────── */
.topbar-bell {
  position: relative;
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--ink);
  cursor: pointer;
  flex-shrink: 0;
}
.topbar-bell:hover { background: var(--surface-3); }
.topbar-bell svg { width: 18px; height: 18px; }
.topbar-bell .bell-dot {
  position: absolute;
  top: 6px; right: 8px;
  width: 8px; height: 8px;
  border-radius: 999px;
  background: var(--danger);
  border: 2px solid var(--surface);
}
@media (max-width: 575px) {
  .topbar-bell { width: 34px; height: 34px; }
  .topbar-bell svg { width: 16px; height: 16px; }
}

/* ── Cookies banner ───────────────────────────────────── */
.cookies-banner {
  position: fixed;
  bottom: var(--sp-4); left: var(--sp-4); right: var(--sp-4);
  max-width: 720px;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--sp-4);
  display: flex; align-items: center; gap: var(--sp-4);
  z-index: 60;
  box-shadow: var(--shadow-lg);
  animation: slideUp .35s ease-out;
}
@keyframes slideUp { from { transform: translateY(40px); opacity: 0 } to { transform: translateY(0); opacity: 1 } }
.cookies-text {
  flex: 1;
  font-size: var(--fs-sm);
  color: var(--muted);
  line-height: 1.5;
}
.cookies-actions {
  display: flex; gap: var(--sp-2);
  flex-shrink: 0;
}
@media (max-width: 767px) {
  .cookies-banner {
    flex-direction: column;
    align-items: stretch;
    bottom: 80px; /* над bottom-nav */
  }
  .cookies-actions { width: 100%; }
  .cookies-actions .btn { flex: 1; }
}

/* ── Empty state ──────────────────────────────────────── */
.empty-state {
  background: var(--surface);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: var(--sp-8) var(--sp-5);
  text-align: center;
  color: var(--muted);
}
.empty-state .empty-icon {
  width: 64px; height: 64px;
  margin: 0 auto var(--sp-4);
  border-radius: var(--radius);
  background: var(--surface-2);
  display: grid; place-items: center;
  color: var(--p1);
}
.empty-state .empty-icon svg { width: 28px; height: 28px; }
.empty-state h3 {
  color: var(--ink);
  font-size: var(--fs-lg);
  margin-bottom: var(--sp-2);
}
.empty-state p { font-size: var(--fs-sm); max-width: 420px; margin: 0 auto; }
.empty-state .btn { margin-top: var(--sp-4); }
.crumbs .sep { opacity: .5; margin: 0 6px; }
.crumbs .here { color: var(--ink); }

.bal-row { display: flex; gap: var(--sp-2); align-items: center; }
.bal-pill {
  display: flex; align-items: center; gap: var(--sp-2);
  padding: 6px 12px 6px 6px;
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.bal-pill .coin {
  width: 24px; height: 24px;
  border-radius: var(--radius-pill);
  display: grid; place-items: center;
  font-size: 11px; font-weight: 800;
}
.bal-pill.is-coin  .coin { background: linear-gradient(135deg, var(--p1), var(--p2)); color: var(--bg); }
.bal-pill.is-token .coin { background: linear-gradient(135deg, var(--gold), #f7da7a); color: #1a1308; }
.bal-pill .ticker { color: var(--muted); font-size: 9px; letter-spacing: .1em; text-transform: uppercase; display: block; line-height: 1; margin-bottom: 2px; }
.bal-pill .val    { display: block; line-height: 1; }
.bal-pill .add {
  width: 22px; height: 22px;
  border-radius: var(--radius-pill);
  background: rgba(var(--p1-rgb), .18);
  color: var(--p1);
  display: grid; place-items: center;
  border: 0;
  font-size: 14px; font-weight: 700;
  cursor: pointer;
  margin-left: 2px;
}

/* Мобайл (<576): компактные pill — только coin + value */
@media (max-width: 575px) {
  .bal-pill {
    padding: 6px 10px 6px 6px;
    font-size: var(--fs-xs);
  }
  .bal-pill .ticker { display: none; }
  .bal-pill .add    { display: none; }
  .topbar { padding: 10px 12px; gap: 8px; }
  .bal-row { gap: 6px; }
  .avatar { width: 34px; height: 34px; }
}

.avatar {
  width: 38px; height: 38px;
  border-radius: var(--radius-pill);
  background: linear-gradient(135deg, var(--p2), var(--p1));
  display: grid; place-items: center;
  color: var(--bg);
  font-weight: 800; font-size: var(--fs-md);
  cursor: pointer;
  border: 1px solid var(--line);
}

/* ── Bottom nav (мобайл) ──────────────────────────────── */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  display: none;
  justify-content: space-around;
  background: var(--surface);
  border-top: 1px solid var(--line);
  padding: 8px 4px calc(8px + env(safe-area-inset-bottom));
  z-index: 50;
}
.bottom-nav a {
  flex: 1; max-width: 80px;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 6px 4px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
}
.bottom-nav a svg { width: 22px; height: 22px; }
.bottom-nav a.is-active { color: var(--p1); }
@media (max-width: 1023px) { .bottom-nav { display: flex; } }

/* ── Кнопки ───────────────────────────────────────────── */
.btn {
  appearance: none;
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  padding: 11px 18px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--ink);
  font-weight: 600; font-size: var(--fs-sm);
  cursor: pointer;
  transition: transform .1s var(--ease), background .18s, border-color .18s, box-shadow .18s;
  font-family: inherit;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { background: var(--surface-3); border-color: var(--line-strong); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.btn-primary {
  background: linear-gradient(135deg, var(--p1), var(--p2));
  border: 0;
  color: var(--bg);
  box-shadow: 0 6px 28px -10px rgba(var(--p1-rgb), .7);
}
.btn-primary:hover { background: linear-gradient(135deg, var(--p1), var(--p2)); filter: brightness(1.08); }
.btn-danger  { background: var(--danger); border: 0; color: #fff; }
.btn-success { background: var(--success); border: 0; color: var(--bg); }
.btn-ghost   { background: transparent; }
.btn-block   { display: flex; width: 100%; }
.btn-sm      { padding: 7px 12px; font-size: var(--fs-xs); }
.btn-lg      { padding: 15px 24px; font-size: var(--fs-md); }
.btn-xl      { padding: 20px 30px; font-size: var(--fs-lg); }
.btn svg     { width: 16px; height: 16px; }
.btn-lg svg, .btn-xl svg { width: 18px; height: 18px; }

/* ── Карточки ─────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--sp-5);
  position: relative;
}
.card-tight { padding: var(--sp-4); }
.card-flat { background: var(--surface-2); }
.card h3 { margin-bottom: var(--sp-3); font-size: var(--fs-lg); }
.card .card-sub { color: var(--muted); font-size: var(--fs-sm); margin-top: -4px; margin-bottom: var(--sp-4); }

/* ── Chips & badges ───────────────────────────────────── */
.chip {
  display: inline-flex; align-items: center; gap: var(--sp-2);
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: .04em;
  color: var(--muted);
  text-transform: uppercase;
  font-family: var(--font-mono);
}
.chip-live::before {
  content: ""; width: 6px; height: 6px; border-radius: 999px;
  background: var(--success);
  box-shadow: 0 0 8px var(--success);
  animation: pulse 1.4s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1 } 50% { opacity: .35 } }
.chip-tag { background: rgba(var(--p1-rgb), .14); color: var(--p1); border-color: rgba(var(--p1-rgb), .28); }
.chip-gold { background: rgba(var(--gold-rgb), .12); color: var(--gold); border-color: rgba(var(--gold-rgb), .28); }
.chip-success { background: rgba(var(--success-rgb), .12); color: var(--success); border-color: rgba(var(--success-rgb), .28); }
.chip-danger { background: rgba(var(--danger-rgb), .12); color: var(--danger); border-color: rgba(var(--danger-rgb), .28); }

/* ── Segmented control ────────────────────────────────── */
.seg {
  display: inline-flex;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  padding: 4px;
  gap: 2px;
}
.seg button {
  appearance: none; border: 0; background: transparent;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  color: var(--muted);
  font-weight: 600; font-size: var(--fs-sm);
  cursor: pointer;
  font-family: inherit;
}
.seg button:hover { color: var(--ink); }
.seg button.is-active {
  background: var(--ink);
  color: var(--bg);
}

/* ── Инпуты ───────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: var(--sp-3); }
.field-label { font-size: var(--fs-xs); color: var(--muted); letter-spacing: .04em; text-transform: uppercase; font-weight: 600; }
.input, textarea.input {
  appearance: none;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  color: var(--ink);
  font-family: inherit;
  font-size: var(--fs-md);
  outline: none;
  transition: border-color .18s, background .18s;
  width: 100%;
}
.input:focus, textarea.input:focus { border-color: var(--p1); background: var(--surface-3); }
.input-mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

.input-group {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  display: flex; align-items: center; gap: var(--sp-2);
}
.input-group input {
  flex: 1;
  appearance: none; background: transparent; border: 0;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: var(--fs-xl);
  font-weight: 700;
  outline: none;
  width: 100%;
}
.input-group .suffix { color: var(--muted); font-size: var(--fs-xs); font-weight: 600; letter-spacing: .1em; text-transform: uppercase; flex-shrink: 0; }

.quick-amounts {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px;
  margin-top: var(--sp-2);
}
.quick-amounts button {
  appearance: none; background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--muted);
  padding: 7px 10px; border-radius: var(--radius-xs);
  font-family: var(--font-mono); font-size: var(--fs-xs);
  cursor: pointer; font-weight: 600;
}
.quick-amounts button:hover { color: var(--ink); border-color: var(--line-strong); }

.checkbox {
  display: inline-flex; align-items: center; gap: var(--sp-2);
  cursor: pointer;
  font-size: var(--fs-sm);
  color: var(--muted);
}
.checkbox input { width: 16px; height: 16px; accent-color: var(--p1); }

/* ── Stats ────────────────────────────────────────────── */
.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--sp-4);
}
.stat-label { font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.stat-value {
  font-family: var(--font-mono);
  font-size: var(--fs-xl);
  font-weight: 700;
  margin-top: 6px;
  letter-spacing: -.01em;
}
.stat-value .unit { color: var(--muted); font-size: var(--fs-xs); margin-left: 2px; }
.stat-delta { font-size: var(--fs-xs); color: var(--success); font-family: var(--font-mono); margin-top: 2px; }
.stat-delta.is-neg { color: var(--danger); }

/* ── Hero ─────────────────────────────────────────────── */
.hero {
  position: relative;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(ellipse at 80% 50%, rgba(var(--p2-rgb), .22), transparent 55%),
    radial-gradient(ellipse at 20% 100%, rgba(var(--p1-rgb), .28), transparent 60%),
    var(--surface);
  border: 1px solid var(--line);
  padding: var(--sp-7);
  overflow: hidden;
  min-height: 280px;
  display: flex; align-items: center;
}
.hero h1 {
  font-size: clamp(28px, 4.4vw, 52px);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -.025em;
  max-width: 580px;
  margin-bottom: var(--sp-3);
}
.hero p { color: var(--muted); max-width: 480px; font-size: var(--fs-lg); margin-bottom: var(--sp-5); }
.hero-actions { display: flex; gap: var(--sp-3); flex-wrap: wrap; }
.hero-art {
  position: absolute; right: 0; top: 0; bottom: 0;
  width: 45%;
  pointer-events: none;
  display: grid; place-items: center;
  opacity: .92;
}
@media (max-width: 767px) { .hero-art { display: none; } }

/* ── Tile (квадратные карточки) ───────────────────────── */
.tile {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--sp-4);
  display: flex; flex-direction: column; gap: var(--sp-2);
  cursor: pointer;
  transition: transform .18s var(--ease), box-shadow .18s var(--ease), border-color .18s;
  min-height: 150px;
  text-decoration: none; color: inherit;
}
.tile:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--line-strong); }
.tile-title  { font-family: var(--font-display); font-size: var(--fs-lg); font-weight: 700; }
.tile-reward { font-family: var(--font-mono); font-size: var(--fs-sm); color: var(--p1); font-weight: 600; margin-top: auto; }

/* ── Progress bar ─────────────────────────────────────── */
.progress {
  height: 6px;
  background: var(--surface-2);
  border-radius: var(--radius-pill);
  overflow: hidden;
}
.progress .fill {
  height: 100%;
  background: linear-gradient(90deg, var(--p1), var(--p2));
  transition: width .3s var(--ease);
}

/* ── Toast ────────────────────────────────────────────── */
.toast-stack {
  position: fixed; top: 20px; right: 20px;
  z-index: 9000;
  display: flex; flex-direction: column; gap: 8px;
  max-width: 380px; pointer-events: none;
}
.toast {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--p1);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: var(--fs-sm);
  box-shadow: var(--shadow);
  pointer-events: auto;
  animation: slideIn .25s ease-out;
}
.toast.is-win  { border-left-color: var(--success); }
.toast.is-loss { border-left-color: var(--danger);  }
.toast .toast-title { font-weight: 700; margin-bottom: 2px; }
.toast .toast-body  { color: var(--muted); font-size: var(--fs-xs); }
@keyframes slideIn { from { transform: translateX(20px); opacity: 0 } to { transform: translateX(0); opacity: 1 } }

/* ── Modal ────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(5, 7, 20, .72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 9100;
  display: grid; place-items: center;
  padding: var(--sp-4);
}
.modal-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: var(--sp-7);
  max-width: 480px; width: 100%;
  position: relative;
  box-shadow: var(--shadow-lg);
}
.modal-card .modal-x {
  position: absolute; top: 12px; right: 12px;
  width: 32px; height: 32px;
  border-radius: var(--radius-pill);
  background: transparent;
  border: 0;
  color: var(--muted);
  cursor: pointer;
  display: grid; place-items: center;
}
.modal-card .modal-x:hover { background: var(--surface-2); color: var(--ink); }

/* ── Tables / rows ────────────────────────────────────── */
.tx-row {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3);
  padding: var(--sp-3) 0;
  border-bottom: 1px solid var(--line);
}
.tx-row:last-child { border-bottom: 0; }
.tx-row .tx-title { font-weight: 600; font-size: var(--fs-sm); }
.tx-row .tx-date  { font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--muted-dim); }
.tx-row .tx-amount { font-family: var(--font-mono); font-weight: 700; font-size: var(--fs-sm); }

/* ── Game stage (общее для всех игр) ──────────────────── */
.game-stage {
  position: relative;
  background:
    radial-gradient(ellipse at 30% 100%, rgba(var(--p1-rgb), .22), transparent 60%),
    radial-gradient(ellipse at 70% 0%, rgba(var(--p2-rgb), .14), transparent 60%),
    #050720;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 16 / 10;
  min-height: 360px;
}
@media (max-width: 767px) {
  .game-stage { min-height: 260px; aspect-ratio: 4/3; }
}
@media (max-width: 575px) {
  .game-stage { min-height: 220px; }
  /* компактнее заголовок на узких экранах */
  .page-head h1 { font-size: var(--fs-2xl); }
  .seg button { padding: 6px 10px; font-size: var(--fs-xs); }
}
.bet-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--sp-5);
}
.bet-action {
  width: 100%;
  padding: 22px;
  border-radius: var(--radius-sm);
  border: 0;
  background: linear-gradient(135deg, var(--p1), var(--p2));
  color: var(--bg);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--fs-lg);
  letter-spacing: .04em;
  text-transform: uppercase;
  cursor: pointer;
  transition: filter .18s, transform .1s;
}
.bet-action:hover { filter: brightness(1.1); }
.bet-action:active { transform: translateY(1px); }
.bet-action.is-cashout { background: linear-gradient(135deg, #ff8855, var(--danger)); animation: cashoutGlow 1.2s ease-in-out infinite; }
@keyframes cashoutGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 90, 90, .5); }
  50%      { box-shadow: 0 0 0 12px rgba(255, 90, 90, 0); }
}
.bet-action.is-waiting { background: var(--surface-2); color: var(--muted); cursor: default; }

/* история раундов (pills) */
.history-strip { display: flex; gap: 6px; flex-wrap: wrap; }
.h-pill {
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 700;
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.h-pill.is-hi  { color: var(--success); border-color: rgba(var(--success-rgb), .3); }
.h-pill.is-mid { color: var(--ink); }
.h-pill.is-lo  { color: var(--danger);  border-color: rgba(var(--danger-rgb), .3); }

/* мультипликатор */
.multiplier {
  position: absolute; left: 50%; top: 30%;
  transform: translate(-50%, -50%);
  font-family: var(--font-mono);
  font-size: clamp(40px, 6.4vw, 72px);
  font-weight: 800;
  letter-spacing: -.04em;
  color: var(--ink);
  text-shadow: 0 0 30px rgba(var(--p1-rgb), .5);
  z-index: 3;
  pointer-events: none;
  text-align: center;
}
.multiplier.is-crashed { color: var(--danger); text-shadow: 0 0 40px var(--danger); }
.multiplier.is-cashed  { color: var(--success); text-shadow: 0 0 40px var(--success); }
.multiplier .status {
  display: block;
  font-family: var(--font-sans);
  font-size: 11px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 6px;
  text-shadow: none;
}

/* список игроков */
.players-list {
  display: flex; flex-direction: column; gap: 6px;
  max-height: 320px;
  overflow: auto;
  padding-right: 4px;
}
.player-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 12px;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  font-size: var(--fs-sm);
  border: 1px solid transparent;
}
.player-row .nick { font-family: var(--font-mono); color: var(--muted); }
.player-row .mult { font-family: var(--font-mono); font-weight: 700; }
.player-row.is-win  { border-color: rgba(var(--success-rgb), .28); }
.player-row.is-win  .mult { color: var(--success); }
.player-row.is-loss .mult { color: var(--danger); opacity: .6; }

/* ── Mines поле ───────────────────────────────────────── */
.mines-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--sp-2);
  max-width: 480px;
  margin: 0 auto;
}
.mines-cell {
  aspect-ratio: 1;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  display: grid; place-items: center;
  cursor: pointer;
  font-size: 22px;
  color: var(--muted-dim);
  transition: background .15s, transform .15s, border-color .15s;
  position: relative;
}
.mines-cell:hover { background: var(--surface-3); }
.mines-cell.is-open {
  background: linear-gradient(135deg, rgba(var(--success-rgb), .2), rgba(var(--success-rgb), .08));
  border-color: rgba(var(--success-rgb), .35);
  color: var(--success);
  cursor: default;
}
.mines-cell.is-bomb {
  background: linear-gradient(135deg, rgba(var(--danger-rgb), .3), rgba(var(--danger-rgb), .1));
  border-color: var(--danger);
  color: var(--danger);
  cursor: default;
  animation: boom .4s ease-out;
}
.mines-cell.is-revealed-bomb {
  background: var(--surface);
  color: rgba(var(--danger-rgb), .5);
  cursor: default;
}
@keyframes boom { 0% { transform: scale(.7); } 50% { transform: scale(1.15); } 100% { transform: scale(1); } }

/* ── Plinko ───────────────────────────────────────────── */
.plinko-stage {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  position: relative;
  overflow: hidden;
  aspect-ratio: 4/5;
}
.plinko-stage canvas { width: 100%; height: 100%; display: block; }
.plinko-buckets {
  display: flex; gap: 4px;
  padding: var(--sp-3) var(--sp-4);
  background: var(--surface-2);
  border-top: 1px solid var(--line);
}
.plinko-buckets .bucket {
  flex: 1; text-align: center;
  padding: var(--sp-2) 4px;
  border-radius: var(--radius-xs);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 700;
  background: var(--surface);
}
.plinko-buckets .bucket.b-hi { color: var(--danger); box-shadow: inset 0 0 0 1px rgba(var(--danger-rgb), .3); }
.plinko-buckets .bucket.b-mid { color: var(--p1); box-shadow: inset 0 0 0 1px rgba(var(--p1-rgb), .3); }
.plinko-buckets .bucket.b-lo { color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); }

/* ── Wheel ────────────────────────────────────────────── */
.wheel-stage {
  position: relative;
  aspect-ratio: 1;
  max-width: 420px;
  margin: 0 auto;
}
.wheel-pointer {
  position: absolute;
  top: -6px; left: 50%;
  transform: translateX(-50%);
  width: 0; height: 0;
  border-left: 14px solid transparent;
  border-right: 14px solid transparent;
  border-top: 22px solid var(--gold);
  z-index: 3;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, .5));
}
.wheel-disc {
  width: 100%; height: 100%;
  transition: transform 4s cubic-bezier(.17, .67, .12, 1);
  transform-origin: 50% 50%;
}

/* ── Coinflip ─────────────────────────────────────────── */
.coin-stage {
  perspective: 1000px;
  display: grid; place-items: center;
  min-height: 320px;
}
.coin {
  width: 180px; height: 180px;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 2.5s cubic-bezier(.5, .15, .25, 1);
}
.coin .face {
  position: absolute; inset: 0;
  border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 48px;
  color: var(--bg);
  backface-visibility: hidden;
  border: 4px solid rgba(255, 255, 255, .15);
}
.coin .face.heads {
  background: radial-gradient(circle at 35% 25%, #fff, var(--gold) 50%, #b88a2a);
}
.coin .face.tails {
  background: radial-gradient(circle at 35% 25%, #fff, var(--p2) 50%, var(--p1-dim));
  transform: rotateY(180deg);
}

/* ── Dice slider ──────────────────────────────────────── */
.dice-track {
  position: relative;
  height: 56px;
  background: linear-gradient(to right,
    var(--danger) 0%,
    var(--danger) var(--threshold, 50%),
    var(--success) var(--threshold, 50%),
    var(--success) 100%);
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--line);
}
.dice-track .marker {
  position: absolute;
  top: 0; bottom: 0;
  left: var(--threshold, 50%);
  width: 3px;
  background: var(--ink);
  box-shadow: 0 0 10px var(--ink);
  transform: translateX(-50%);
}
.dice-track .roll-pin {
  position: absolute;
  top: -10px; left: var(--roll, 50%);
  width: 24px; height: 76px;
  transform: translateX(-50%);
  pointer-events: none;
  transition: left .8s cubic-bezier(.5, .1, .2, 1);
}
.dice-track .roll-pin::after {
  content: ""; position: absolute; left: 50%; top: 0;
  transform: translateX(-50%);
  border-left: 9px solid transparent;
  border-right: 9px solid transparent;
  border-top: 14px solid var(--gold);
}
.dice-track .roll-pin::before {
  content: ""; position: absolute; left: 50%; bottom: 0;
  transform: translateX(-50%);
  border-left: 9px solid transparent;
  border-right: 9px solid transparent;
  border-bottom: 14px solid var(--gold);
}
.dice-scale {
  display: flex; justify-content: space-between;
  font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--muted);
  margin-top: 6px;
}

/* ── Wheel pill (для скинов ракеты в магазине и пр) ───── */
.shop-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--sp-4);
  text-align: center;
}
.shop-card .preview {
  aspect-ratio: 1;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  display: grid; place-items: center;
  margin-bottom: var(--sp-3);
  position: relative; overflow: hidden;
}

/* ── Chart styles ─────────────────────────────────────── */
.chart-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--sp-5);
}
.chart-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: var(--sp-3); flex-wrap: wrap;
  margin-bottom: var(--sp-4);
}
.chart-price {
  font-family: var(--font-mono);
  font-size: var(--fs-3xl);
  font-weight: 800;
  letter-spacing: -.02em;
}
.chart-host { position: relative; width: 100%; }
.chart-host canvas, .chart-host svg { display: block; width: 100%; height: 100%; }

/* ── Affiliate ad slot ────────────────────────────────── */
.ad-slot {
  position: relative;
  background: var(--surface-2);
  border: 1px dashed rgba(var(--p1-rgb), .35);
  border-radius: var(--radius);
  padding: var(--sp-4);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--muted);
  display: flex; align-items: center; gap: var(--sp-3);
  min-height: 80px;
}
.ad-slot .ad-tag {
  position: absolute; top: 8px; right: 12px;
  font-size: 9px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted-dim);
}
.ad-slot .ad-icon {
  width: 56px; height: 56px;
  border-radius: var(--radius-sm);
  background: repeating-linear-gradient(135deg, rgba(var(--p1-rgb), .18) 0 6px, transparent 6px 12px);
  border: 1px solid var(--line);
  flex-shrink: 0;
  display: grid; place-items: center;
  font-size: 22px;
  color: var(--p1);
}
.ad-slot strong {
  color: var(--ink);
  display: block;
  margin-bottom: 2px;
  font-family: var(--font-sans);
  font-size: var(--fs-sm);
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0;
}

/* ── Leaderboard ──────────────────────────────────────── */
.lb-row {
  display: grid;
  grid-template-columns: 40px 1fr 110px 130px;
  gap: var(--sp-3);
  align-items: center;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
}
.lb-row .lb-rank { font-family: var(--font-mono); font-weight: 700; color: var(--muted); }
.lb-row.is-top1 .lb-rank { color: var(--gold); font-size: var(--fs-lg); }
.lb-row.is-top2 .lb-rank { color: #c0c5d6; font-size: var(--fs-md); }
.lb-row.is-top3 .lb-rank { color: #cf9c6a; font-size: var(--fs-md); }
.lb-row.is-me   { border-color: var(--p1); background: rgba(var(--p1-rgb), .08); }
.lb-row .lb-nick { display: flex; align-items: center; gap: 10px; min-width: 0; }
.lb-row .lb-val  { font-family: var(--font-mono); font-weight: 700; text-align: right; }
@media (max-width: 575px) {
  .lb-row { grid-template-columns: 32px 1fr 90px; }
  .lb-row .lb-val.hide-sm { display: none; }
}

/* ── Skeleton (для loading state) ─────────────────────── */
.skeleton {
  background: linear-gradient(90deg, var(--surface-2) 0%, var(--surface-3) 50%, var(--surface-2) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
  border-radius: var(--radius-sm);
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ── Tab nav (под чарт-таймфреймы) ────────────────────── */
.tabs {
  display: flex; gap: 2px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  padding: 3px;
}
.tabs button {
  appearance: none; background: transparent; border: 0;
  padding: 6px 12px; font-family: var(--font-mono);
  font-size: var(--fs-xs); font-weight: 600;
  color: var(--muted); cursor: pointer;
  border-radius: var(--radius-pill);
}
.tabs button.is-active { background: var(--ink); color: var(--bg); }
