:root {
  --bg: #080b0a;
  --bg-2: #0d1211;
  --panel: rgba(18, 24, 22, 0.86);
  --panel-2: rgba(23, 31, 28, 0.9);
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.14);
  --text: #eef3ef;
  --muted: #8b9a93;
  --gold: #f4c95d;
  --gold-2: #d9a83a;
  --green: #2fd47a;
  --green-soft: rgba(47, 212, 122, 0.14);
  --red: #f0484f;
  --red-soft: rgba(240, 72, 79, 0.14);
  --radius: 18px;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; }

/* display-утилиты выше по каскаду не должны перебивать hidden */
[hidden] { display: none !important; }

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

body {
  margin: 0;
  background: radial-gradient(1200px 700px at 50% -10%, #17231d 0%, var(--bg) 55%) fixed, var(--bg);
  color: var(--text);
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -0.01em; }
h2 { font-size: 1.35rem; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
b { font-variant-numeric: tabular-nums; }

.muted { color: var(--muted); }
.tiny { font-size: 0.78rem; }
.empty { color: var(--muted); font-size: 0.85rem; padding: 6px 0; }

button { font-family: inherit; cursor: pointer; }
input { font-family: inherit; }

/* ---------- background decoration ---------- */
.bg-orbs { position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.bg-orbs span {
  position: absolute; border-radius: 50%; filter: blur(90px); opacity: 0.35;
  animation: drift 22s ease-in-out infinite alternate;
}
.bg-orbs span:nth-child(1) { width: 460px; height: 460px; background: #13653f; top: -140px; left: -80px; }
.bg-orbs span:nth-child(2) { width: 380px; height: 380px; background: #7a4d10; bottom: -160px; right: -60px; animation-delay: -7s; }
.bg-orbs span:nth-child(3) { width: 300px; height: 300px; background: #2b3f7a; top: 40%; left: 55%; animation-delay: -13s; opacity: 0.22; }
@keyframes drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(60px, 40px, 0) scale(1.12); }
}

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 18px;
  padding: 12px clamp(14px, 3vw, 34px);
  background: rgba(8, 11, 10, 0.82);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text);
  flex-shrink: 0;
}
.brand-mark {
  display: grid; place-items: center;
  width: 38px; height: 38px; border-radius: 12px;
  background: linear-gradient(150deg, #f7dc8e, var(--gold-2));
  color: #20190a; font-size: 1.35rem; font-weight: 800;
  box-shadow: 0 6px 20px rgba(244, 201, 93, 0.28);
}
.brand-text { font-weight: 800; letter-spacing: 0.14em; font-size: 0.95rem; }
.brand-text em { font-style: normal; color: var(--gold); }

.tabs { display: flex; gap: 4px; margin-left: 8px; flex-wrap: wrap; }
.tab {
  border: 1px solid transparent; background: transparent; color: var(--muted);
  padding: 9px 15px; border-radius: 11px; font-size: 0.92rem; font-weight: 600;
  display: inline-flex; align-items: center; gap: 7px;
  transition: 0.18s;
}
.tab:hover { color: var(--text); background: rgba(255, 255, 255, 0.045); }
.tab.active {
  color: #16120a; background: linear-gradient(150deg, #f7e3a8, var(--gold));
  box-shadow: 0 6px 22px rgba(244, 201, 93, 0.22);
}
.tab span { font-size: 1rem; }

.wallet { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.chip {
  display: flex; flex-direction: column; align-items: flex-end; justify-content: center;
  padding: 6px 13px; border-radius: 12px; border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.035); min-width: 92px;
}
.chip-label { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); }
.chip b { font-size: 1.02rem; }
.chip-balance b { color: var(--gold); }
.chip-win b { color: var(--green); }
.chip-win { background: var(--green-soft); border-color: rgba(47, 212, 122, 0.24); }

.icon-btn {
  width: 38px; height: 38px; border-radius: 11px; border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.035); color: var(--text); font-size: 1rem;
}
.icon-btn:hover { border-color: var(--line-strong); }

.user-btn {
  display: flex; align-items: center; gap: 8px; max-width: 190px;
  padding: 5px 12px 5px 5px; border-radius: 999px;
  border: 1px solid var(--line); background: rgba(255, 255, 255, 0.035); color: var(--text);
}
.user-btn:hover { border-color: var(--gold); }
.avatar {
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(150deg, #2d6b4c, #16402d); color: #c9f5dd;
  font-weight: 700; font-size: 0.85rem; flex-shrink: 0;
}
.avatar.big { width: 48px; height: 48px; font-size: 1.15rem; }
.user-name { font-size: 0.88rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- layout ---------- */
.layout {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: minmax(0, 1fr) 320px;
  gap: 20px; padding: 22px clamp(14px, 3vw, 34px) 10px;
  max-width: 1440px; margin: 0 auto;
  align-items: start;
}

.view { display: none; animation: fadeUp 0.28s ease; }
.view.active { display: block; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.panel {
  position: relative;
  background: linear-gradient(170deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(16px, 2.4vw, 26px);
  overflow: hidden;
}
.panel::before {
  content: ""; position: absolute; inset: 0 0 auto; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(244, 201, 93, 0.45), transparent);
}
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.panel-head p { margin-top: 4px; font-size: 0.88rem; max-width: 52ch; }
.round-badge {
  flex-shrink: 0; font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--gold); border: 1px solid rgba(244, 201, 93, 0.3); background: rgba(244, 201, 93, 0.08);
  padding: 5px 10px; border-radius: 999px;
}

/* ---------- controls ---------- */
.bet-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin-top: 18px; }
.bet-field { display: flex; flex-direction: column; gap: 6px; min-width: 130px; }
.bet-field > span { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); }
.bet-field input,
.field input {
  width: 100%; padding: 11px 13px; border-radius: 12px;
  border: 1px solid var(--line-strong); background: rgba(0, 0, 0, 0.3); color: var(--text);
  font-size: 1rem; font-variant-numeric: tabular-nums; outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.bet-field input:focus, .field input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(244, 201, 93, 0.12); }
.bet-field input::-webkit-outer-spin-button, .bet-field input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.presets { display: flex; gap: 6px; flex-wrap: wrap; }
.presets button {
  padding: 9px 11px; min-width: 42px; border-radius: 10px;
  border: 1px solid var(--line); background: rgba(255, 255, 255, 0.04); color: var(--muted);
  font-size: 0.82rem; font-weight: 600; transition: 0.15s;
}
.presets button:hover { color: var(--text); border-color: var(--line-strong); background: rgba(255, 255, 255, 0.08); }

.btn {
  border: 1px solid transparent; border-radius: 13px; padding: 12px 22px;
  font-size: 0.95rem; font-weight: 700; letter-spacing: 0.02em; color: #14100a;
  background: linear-gradient(150deg, #f7e3a8, var(--gold));
  box-shadow: 0 10px 26px rgba(244, 201, 93, 0.18);
  transition: transform 0.12s, filter 0.15s, opacity 0.15s;
}
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; box-shadow: none; }
.btn-spin, .btn-crash { margin-left: auto; min-width: 170px; }
.btn-ghost {
  background: rgba(255, 255, 255, 0.04); border-color: var(--line-strong); color: var(--text);
  box-shadow: none; font-weight: 600;
}
.btn-ghost:hover { background: rgba(255, 255, 255, 0.08); }
.btn-primary { background: linear-gradient(150deg, #45e08c, #1fae61); color: #06170d; }
.btn-danger { background: linear-gradient(150deg, #f06b71, #b81f27); color: #fff; }
.text-gold { color: var(--gold); }

/* ---------- slots ---------- */
.slot-modes { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.mode-btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 13px; border-radius: 11px; font-size: 0.86rem; font-weight: 600;
  border: 1px solid var(--line); background: rgba(255, 255, 255, 0.035); color: var(--muted);
  transition: 0.15s;
}
.mode-btn span {
  font-size: 0.68rem; font-weight: 700; letter-spacing: 0.06em;
  padding: 1px 6px; border-radius: 6px; background: rgba(255, 255, 255, 0.07);
}
.mode-btn:hover { color: var(--text); border-color: var(--line-strong); }
.mode-btn.active {
  color: var(--gold); border-color: rgba(244, 201, 93, 0.45); background: rgba(244, 201, 93, 0.12);
}
.mode-btn.active span { background: rgba(244, 201, 93, 0.2); }

.slot-grid {
  display: grid; gap: clamp(4px, 0.9vw, 9px);
  max-width: 620px; margin: 0 auto;
}
.slot-grid[data-cols="5"] { grid-template-columns: repeat(5, 1fr); }
.grid-cell {
  position: relative; display: grid; place-items: center; overflow: hidden;
  border-radius: 11px; border: 1px solid var(--line-strong);
  background: linear-gradient(180deg, #0b0f0d, #151d19 50%, #0b0f0d);
  box-shadow: inset 0 6px 20px rgba(0, 0, 0, 0.65);
  aspect-ratio: 1;
}
.grid-cell .gsym {
  font-size: clamp(1.15rem, 3.6vw, 2.3rem); line-height: 1;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.5));
  transition: transform 0.12s;
}
.grid-cell.spinning .gsym { animation: reelBlur 0.11s linear infinite; }
.grid-cell.spinning::before {
  content: ""; position: absolute; inset: -20% 0; z-index: 2; pointer-events: none;
  background: repeating-linear-gradient(180deg,
      rgba(255, 255, 255, 0.12) 0 2px,
      rgba(255, 255, 255, 0) 2px 9px);
  background-size: 100% 18px;
  animation: streak 0.16s linear infinite;
  mask-image: linear-gradient(180deg, transparent, #000 20%, #000 80%, transparent);
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 20%, #000 80%, transparent);
}
.grid-cell.land { animation: land 0.3s cubic-bezier(0.2, 1.4, 0.4, 1); }
.grid-cell.win {
  border-color: var(--gold);
  background: linear-gradient(180deg, #1d1a0f, #2a2415);
  box-shadow: inset 0 0 22px rgba(244, 201, 93, 0.28), 0 0 18px rgba(244, 201, 93, 0.18);
}
.grid-cell.win .gsym { animation: pop 0.42s ease; }

.slots-extra { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 12px; }
.btn-auto {
  background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line-strong); color: var(--text);
  box-shadow: none; font-weight: 600; padding: 9px 18px; font-size: 0.88rem;
}
.btn-auto:hover { background: rgba(255, 255, 255, 0.09); }
.btn-auto.running {
  background: linear-gradient(150deg, #45e08c, #1fae61); color: #06170d; border-color: transparent;
}
.spin-count { display: flex; align-items: center; gap: 7px; font-size: 0.8rem; color: var(--muted); }
.spin-count select {
  padding: 7px 9px; border-radius: 9px; font-size: 0.85rem; font-weight: 600;
  border: 1px solid var(--line-strong); background: rgba(0, 0, 0, 0.32); color: var(--text); outline: none;
}
.auto-left { font-size: 0.82rem; }

.slot-machine {
  position: relative; border-radius: 20px; padding: 26px 18px;
  background:
    radial-gradient(600px 240px at 50% 0%, rgba(244, 201, 93, 0.12), transparent 70%),
    linear-gradient(180deg, #131b17, #0a0e0c);
  border: 1px solid rgba(244, 201, 93, 0.18);
  overflow: hidden;
}
.slot-glow {
  position: absolute; inset: -40% -10% auto; height: 70%;
  background: radial-gradient(closest-side, rgba(244, 201, 93, 0.22), transparent);
  pointer-events: none; opacity: 0.7;
}
.reels { position: relative; display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(8px, 2vw, 18px); max-width: 640px; margin: 0 auto; }
.reel {
  position: relative; height: clamp(110px, 17vw, 156px); border-radius: 16px;
  background: linear-gradient(180deg, #0b0f0d, #151d19 45%, #0b0f0d);
  border: 1px solid var(--line-strong);
  box-shadow: inset 0 10px 30px rgba(0, 0, 0, 0.7);
  display: grid; place-items: center; overflow: hidden;
}
.reel::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.55), transparent 30%, transparent 70%, rgba(0, 0, 0, 0.55));
  pointer-events: none;
}
.reel-symbol { font-size: clamp(3rem, 7vw, 4.6rem); line-height: 1; filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.5)); transition: transform 0.12s; will-change: transform, filter; }

/* прокрутка: смазанный символ + бегущие полосы */
.reel.spinning .reel-symbol { animation: reelBlur 0.11s linear infinite; }
.reel.spinning::before {
  content: ""; position: absolute; inset: -20% 0; z-index: 2; pointer-events: none;
  background:
    repeating-linear-gradient(180deg,
      rgba(255, 255, 255, 0.13) 0 2px,
      rgba(255, 255, 255, 0) 2px 11px);
  background-size: 100% 22px;
  animation: streak 0.16s linear infinite;
  mask-image: linear-gradient(180deg, transparent, #000 22%, #000 78%, transparent);
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 22%, #000 78%, transparent);
  opacity: 0.75;
}
@keyframes reelBlur {
  0% { transform: translateY(-26%) scaleY(0.86); filter: blur(5px); opacity: 0.55; }
  45% { transform: translateY(0) scaleY(1.06); filter: blur(1.2px); opacity: 1; }
  100% { transform: translateY(26%) scaleY(0.86); filter: blur(5px); opacity: 0.55; }
}
@keyframes streak {
  from { background-position: 0 -22px; }
  to { background-position: 0 0; }
}
.reel.land { animation: land 0.32s cubic-bezier(0.2, 1.4, 0.4, 1); }
@keyframes land {
  0% { transform: translateY(10px); }
  60% { transform: translateY(-4px); }
  100% { transform: none; }
}
.reel.win { border-color: var(--gold); box-shadow: inset 0 0 30px rgba(244, 201, 93, 0.25), 0 0 26px rgba(244, 201, 93, 0.2); }
.slot-line {
  position: absolute; left: 8%; right: 8%; top: 50%; height: 1px; pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(244, 201, 93, 0.25), transparent);
}
.slot-result {
  margin: 16px auto 0; text-align: center; font-weight: 700; letter-spacing: 0.04em;
  color: var(--muted); min-height: 24px; font-size: 0.95rem;
}
.slot-result.win { color: var(--gold); animation: pop 0.4s ease; }
.slot-result.lose { color: var(--muted); }
@keyframes pop { 0% { transform: scale(0.92); } 60% { transform: scale(1.04); } 100% { transform: none; } }

.paytable { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 6px; margin-top: 18px; }
.pay-item {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px;
  background: rgba(255, 255, 255, 0.025); border: 1px solid var(--line); font-size: 0.82rem;
}
.pay-item span { font-size: 1.15rem; }
.pay-item b { margin-left: auto; color: var(--gold); font-size: 0.85rem; }

/* ---------- crash ---------- */
.crash-history { display: flex; gap: 5px; flex-wrap: wrap; justify-content: flex-end; max-width: 260px; }
.crash-history i {
  font-style: normal; font-size: 0.72rem; font-weight: 700; font-variant-numeric: tabular-nums;
  padding: 3px 7px; border-radius: 7px; background: rgba(255, 255, 255, 0.05); color: var(--muted);
}
.crash-history i.hot { color: var(--green); background: var(--green-soft); }
.crash-history i.cold { color: var(--red); background: var(--red-soft); }

.crash-stage {
  position: relative; height: clamp(220px, 32vw, 340px); border-radius: 18px; overflow: hidden;
  background: radial-gradient(700px 300px at 20% 0%, rgba(47, 212, 122, 0.09), transparent 65%), #070a09;
  border: 1px solid var(--line);
}
#crashCanvas { 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; }
.crash-mult {
  font-size: clamp(2.8rem, 8vw, 5rem); font-weight: 800; letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums; color: var(--green); text-shadow: 0 0 40px rgba(47, 212, 122, 0.35);
  transition: color 0.2s;
}
.crash-stage.running .crash-mult { color: var(--green); }
.crash-stage.crashed { animation: shake 0.35s; }
.crash-stage.crashed .crash-mult { color: var(--red); text-shadow: 0 0 40px rgba(240, 72, 79, 0.4); }
@keyframes shake {
  0%, 100% { transform: none; }
  25% { transform: translate(-4px, 2px); }
  50% { transform: translate(4px, -2px); }
  75% { transform: translate(-2px, 0); }
}
.crash-status { margin-top: 6px; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.14em; color: var(--muted); }
.crash-crashed {
  position: absolute; right: 16px; top: 12px; font-size: 1.6rem; opacity: 0;
  transition: opacity 0.2s; filter: drop-shadow(0 0 12px rgba(240, 72, 79, 0.6));
}
.crash-stage.crashed .crash-crashed { opacity: 1; }

.btn-crash.take { background: linear-gradient(150deg, #45e08c, #1fae61); color: #06170d; animation: pulse 1.1s infinite; }

/* авто-стоп */
.auto-stop {
  display: flex; align-items: center; gap: 10px; padding: 6px 10px 6px 12px;
  border-radius: 12px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.03);
  height: 44px;
}
.auto-stop.on { border-color: rgba(47, 212, 122, 0.45); background: var(--green-soft); }
.auto-toggle {
  display: flex; align-items: center; gap: 8px; cursor: pointer; user-select: none;
  border: 0; background: transparent; padding: 0; color: inherit;
}
.auto-track {
  position: relative; width: 36px; height: 20px; border-radius: 999px; flex-shrink: 0;
  background: rgba(255, 255, 255, 0.14); transition: background 0.18s;
}
.auto-track i {
  position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%;
  background: #cfd8d3; transition: transform 0.18s, background 0.18s;
}
.auto-stop.on .auto-track { background: var(--green); }
.auto-stop.on .auto-track i { transform: translateX(16px); background: #06251a; }
.auto-text { font-size: 0.82rem; font-weight: 600; color: var(--muted); white-space: nowrap; }
.auto-stop.on .auto-text { color: #b8f7d4; }
.auto-value { display: flex; align-items: center; gap: 2px; }
.auto-value input {
  width: 62px; padding: 5px 6px; border-radius: 8px; text-align: center;
  border: 1px solid var(--line-strong); background: rgba(0, 0, 0, 0.32); color: var(--text);
  font-size: 0.9rem; font-weight: 700; font-variant-numeric: tabular-nums; outline: none;
  -moz-appearance: textfield;
}
.auto-value input::-webkit-outer-spin-button,
.auto-value input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.auto-value input:focus { border-color: var(--green); }
.auto-step {
  width: 24px; height: 26px; border-radius: 7px; padding: 0; line-height: 1;
  border: 1px solid var(--line-strong); background: rgba(255, 255, 255, 0.06);
  color: var(--text); font-size: 0.95rem; font-weight: 700;
}
.auto-step:hover { background: rgba(255, 255, 255, 0.12); border-color: var(--line-strong); }
.auto-value b { color: var(--muted); font-size: 0.85rem; margin-left: 2px; }

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(47, 212, 122, 0.35); }
  50% { box-shadow: 0 0 0 10px rgba(47, 212, 122, 0); }
}

.crash-players { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 14px; }
.crash-players-head { display: flex; justify-content: space-between; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); margin-bottom: 8px; }
.players-list { display: flex; flex-direction: column; gap: 6px; max-height: 190px; overflow-y: auto; }
.players-list li {
  display: flex; align-items: center; gap: 10px; padding: 8px 11px; border-radius: 10px;
  background: rgba(255, 255, 255, 0.03); border: 1px solid var(--line); font-size: 0.87rem;
}
.players-list li .pname { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.players-list li .pbet { color: var(--muted); font-variant-numeric: tabular-nums; margin-left: auto; }
.players-list li .pwin { color: var(--green); font-weight: 700; font-variant-numeric: tabular-nums; }
.players-list li .pauto {
  font-size: 0.72rem; font-weight: 700; color: var(--gold);
  background: rgba(244, 201, 93, 0.12); border: 1px solid rgba(244, 201, 93, 0.28);
  border-radius: 6px; padding: 2px 6px; white-space: nowrap;
}
.players-list li.cashed { border-color: rgba(47, 212, 122, 0.3); background: var(--green-soft); }

/* ---------- мины ---------- */
.mines-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(240px, 330px); gap: 22px; align-items: start; }
.mines-board-wrap { position: relative; }
.mines-board {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: clamp(6px, 1.4vw, 12px);
  max-width: 520px; margin: 0 auto;
}
.mine-cell {
  position: relative; aspect-ratio: 1; border-radius: 13px; padding: 0;
  border: 1px solid var(--line-strong);
  background: linear-gradient(160deg, #18211d, #0d1211);
  box-shadow: inset 0 5px 16px rgba(0, 0, 0, 0.55), 0 3px 8px rgba(0, 0, 0, 0.3);
  font-size: clamp(1.2rem, 3.4vw, 2rem); line-height: 1;
  display: grid; place-items: center;
  transition: transform 0.13s, background 0.18s, border-color 0.18s;
}
.mine-cell:hover:not(:disabled):not(.safe):not(.boom) {
  transform: translateY(-2px); border-color: rgba(244, 201, 93, 0.5);
  background: linear-gradient(160deg, #202b25, #111715);
}
.mine-cell:disabled { cursor: default; }
.mine-cell.safe {
  background: linear-gradient(160deg, #1b6b45, #0d3d27);
  border-color: rgba(47, 212, 122, 0.5);
  box-shadow: inset 0 0 18px rgba(47, 212, 122, 0.22);
  animation: pop 0.32s ease;
}
.mine-cell.boom {
  background: linear-gradient(160deg, #8f1a20, #4a0c10);
  border-color: rgba(240, 72, 79, 0.6);
  animation: boomPulse 0.45s ease;
}
.mine-cell.revealed-mine {
  background: rgba(240, 72, 79, 0.12); border-color: rgba(240, 72, 79, 0.28); opacity: 0.75;
}
.mine-cell.dim { opacity: 0.4; }
@keyframes boomPulse {
  0% { transform: scale(0.9); }
  55% { transform: scale(1.06); }
  100% { transform: none; }
}
.mines-overlay {
  position: absolute; inset: 0; display: grid; place-items: center; border-radius: 16px;
  background: rgba(6, 10, 9, 0.72); backdrop-filter: blur(2px);
  font-size: 1.6rem; font-weight: 800; text-align: center; padding: 20px; pointer-events: none;
}
.mines-overlay.lose { color: #ff9a9e; }
.mines-overlay.win { color: #a8ffcd; }
.mines-side { display: flex; flex-direction: column; gap: 12px; }
.mines-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mstat {
  display: flex; flex-direction: column; gap: 2px; padding: 9px 11px; border-radius: 11px;
  background: rgba(255, 255, 255, 0.03); border: 1px solid var(--line);
}
.mstat span { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.mstat b { font-size: 1.02rem; }
.green-text { color: var(--green); }
.mines-counts { display: flex; gap: 5px; flex-wrap: wrap; }
.mines-counts button {
  flex: 1; min-width: 40px; padding: 8px 6px; border-radius: 9px;
  border: 1px solid var(--line); background: rgba(255, 255, 255, 0.04);
  color: var(--muted); font-weight: 700; font-size: 0.85rem;
}
.mines-counts button:hover:not(:disabled) { color: var(--text); border-color: var(--line-strong); }
.mines-counts button.active {
  color: #14100a; background: linear-gradient(150deg, #f7e3a8, var(--gold)); border-color: transparent;
}
.mines-counts button:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-mines { width: 100%; margin-top: 4px; }
.btn-mines.take { background: linear-gradient(150deg, #45e08c, #1fae61); color: #06170d; }

/* ---------- баннер ---------- */
.jackpot-banner {
  position: relative; display: flex; align-items: center; justify-content: center; gap: 12px;
  margin-bottom: 16px; padding: 14px 18px; border-radius: 14px;
  background:
    radial-gradient(600px 120px at 50% 0%, rgba(244, 201, 93, 0.22), transparent 70%),
    linear-gradient(100deg, rgba(240, 72, 79, 0.14), rgba(244, 201, 93, 0.16), rgba(47, 212, 122, 0.14));
  border: 1px solid rgba(244, 201, 93, 0.42);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  overflow: hidden;
  animation: bannerGlow 3.4s ease-in-out infinite;
}
.jackpot-banner::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(100deg, transparent 20%, rgba(255, 255, 255, 0.16) 50%, transparent 80%);
  transform: translateX(-100%);
  animation: bannerShine 4.5s ease-in-out infinite;
  pointer-events: none;
}
.jb-text {
  font-size: clamp(0.95rem, 2.1vw, 1.22rem); font-weight: 800; letter-spacing: 0.01em;
  text-align: center;
  background: linear-gradient(96deg, #ffe9a8, #f4c95d 35%, #fff6d6 55%, #e0ac3c 80%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 2px 10px rgba(244, 201, 93, 0.35));
}
.jb-spark { color: var(--gold); font-size: 0.95rem; opacity: 0.85; animation: sparkPulse 2s ease-in-out infinite; }
.jb-spark:last-child { animation-delay: -1s; }
@keyframes bannerGlow {
  0%, 100% { border-color: rgba(244, 201, 93, 0.35); }
  50% { border-color: rgba(244, 201, 93, 0.7); }
}
@keyframes bannerShine {
  0%, 55% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}
@keyframes sparkPulse {
  0%, 100% { opacity: 0.45; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1.12); }
}

/* вход в админку из подвала */
.admin-entry {
  width: 22px; height: 22px; padding: 0; margin-left: 4px;
  border: 0; background: transparent; color: #5f6d66; font-size: 0.82rem; line-height: 1;
  opacity: 0.3; cursor: pointer; border-radius: 50%;
  transition: opacity 0.2s, color 0.2s, transform 0.2s;
}
.admin-entry:hover, .admin-entry:focus-visible {
  opacity: 1; color: var(--gold); transform: rotate(45deg) scale(1.2); outline: none;
}

/* ---------- админка ---------- */
.admin-head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.admin-login { max-width: 420px; display: flex; flex-direction: column; gap: 10px; }
.admin-login-form { display: flex; gap: 8px; }
.admin-login-form input {
  flex: 1; min-width: 0; padding: 11px 13px; border-radius: 11px;
  border: 1px solid var(--line-strong); background: rgba(0, 0, 0, 0.3);
  color: var(--text); font-size: 0.95rem; outline: none;
}
.admin-login-form input:focus { border-color: var(--gold); }
.admin-login code { background: rgba(255, 255, 255, 0.07); padding: 1px 5px; border-radius: 4px; font-size: 0.85em; }

.admin-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; margin-bottom: 14px; }
.as-item {
  display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 12px;
  background: rgba(255, 255, 255, 0.03); border: 1px solid var(--line);
}
.as-item span { font-size: 0.64rem; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); }
.as-item b { font-size: 1.02rem; font-variant-numeric: tabular-nums; }
.as-item.gold b { color: var(--gold); }
.as-item.green b { color: var(--green); }
.as-item.red b { color: var(--red); }

.admin-toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 10px; }
.admin-toolbar input[type="search"] {
  flex: 1 1 180px; min-width: 140px; padding: 9px 12px; border-radius: 10px;
  border: 1px solid var(--line-strong); background: rgba(0, 0, 0, 0.3); color: var(--text);
  font-size: 0.88rem; outline: none;
}
.admin-toolbar input[type="search"]:focus { border-color: var(--gold); }
.admin-toolbar select {
  padding: 9px 10px; border-radius: 10px; font-size: 0.84rem;
  border: 1px solid var(--line-strong); background: rgba(0, 0, 0, 0.32); color: var(--text); outline: none;
}

.admin-table-wrap { overflow-x: auto; border-radius: 14px; border: 1px solid var(--line); }
.admin-table { width: 100%; border-collapse: collapse; font-size: 0.84rem; min-width: 760px; }
.admin-table th {
  text-align: left; font-size: 0.64rem; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--muted); font-weight: 600; padding: 8px 12px; border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.025); white-space: nowrap;
}
.admin-table th.num, .admin-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.admin-table th.acts { text-align: center; }
.admin-table td { padding: 8px 12px; border-bottom: 1px solid rgba(255, 255, 255, 0.04); vertical-align: middle; }
.admin-table tr:last-child td { border-bottom: 0; }
.admin-table tbody tr:hover { background: rgba(255, 255, 255, 0.022); }

.au-name { display: flex; align-items: center; gap: 7px; min-width: 0; }
.au-name b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 150px; }
.au-tag {
  font-size: 0.58rem; text-transform: uppercase; letter-spacing: 0.06em;
  padding: 1px 4px; border-radius: 4px; border: 1px solid var(--line-strong); color: var(--muted);
}
.au-tag.guest { color: #9aa8a3; }
.au-tag.admin-flag { color: var(--gold); border-color: rgba(244, 201, 93, 0.35); }
.au-id { font-size: 0.66rem; color: var(--muted); font-family: ui-monospace, monospace; }
.au-debt { color: var(--red); font-size: 0.72rem; }

.admin-acts { display: flex; gap: 4px; justify-content: center; flex-wrap: wrap; }
.mini-btn {
  padding: 5px 9px; border-radius: 8px; font-size: 0.74rem; font-weight: 600;
  border: 1px solid var(--line-strong); background: rgba(255, 255, 255, 0.05); color: var(--text);
  white-space: nowrap;
}
.mini-btn:hover { background: rgba(255, 255, 255, 0.11); border-color: rgba(255, 255, 255, 0.25); }
.mini-btn.plus { color: #9df3c4; border-color: rgba(47, 212, 122, 0.35); }
.mini-btn.plus:hover { background: rgba(47, 212, 122, 0.16); }
.mini-btn.minus { color: #ffb4b7; border-color: rgba(240, 72, 79, 0.35); }
.mini-btn.minus:hover { background: rgba(240, 72, 79, 0.16); }
.mini-btn.gold { color: var(--gold); border-color: rgba(244, 201, 93, 0.35); }
.mini-btn.gold:hover { background: rgba(244, 201, 93, 0.14); }
.mini-btn.danger { color: #ff9a9e; border-color: rgba(240, 72, 79, 0.45); }
.mini-btn.danger:hover { background: rgba(240, 72, 79, 0.22); color: #fff; }

.admin-bottom { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; margin-top: 16px; }
.admin-card { border: 1px solid var(--line); border-radius: 14px; padding: 14px; background: rgba(0, 0, 0, 0.2); }
.admin-card h3 { font-size: 0.9rem; margin-bottom: 10px; }
.admin-inline-form { display: flex; gap: 8px; }
.admin-inline-form input {
  flex: 1; min-width: 0; padding: 9px 11px; border-radius: 9px; font-size: 0.85rem;
  border: 1px solid var(--line-strong); background: rgba(0, 0, 0, 0.3); color: var(--text); outline: none;
}
.admin-inline-form input:focus { border-color: var(--gold); }
.admin-log { display: flex; flex-direction: column; gap: 5px; max-height: 220px; overflow-y: auto; }
.admin-log li { font-size: 0.76rem; display: flex; gap: 8px; padding: 6px 8px; border-radius: 8px; background: rgba(255, 255, 255, 0.025); }
.admin-log li .al-time { color: var(--muted); flex-shrink: 0; font-variant-numeric: tabular-nums; }
.admin-log li .al-text { min-width: 0; word-break: break-word; }

/* модалка админки */
.admin-modal {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 18px;
  background: rgba(4, 7, 6, 0.72); backdrop-filter: blur(4px);
}
.admin-modal-card {
  width: min(420px, 100%); border-radius: 16px; padding: 18px;
  background: linear-gradient(170deg, #171f1b, #0c110f);
  border: 1px solid var(--line-strong); box-shadow: 0 30px 70px rgba(0, 0, 0, 0.6);
  display: flex; flex-direction: column; gap: 12px;
}
.admin-modal-card h3 { font-size: 1.02rem; }
.admin-modal-card .field { display: flex; flex-direction: column; gap: 5px; }
.admin-modal-card .field > span { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.admin-modal-card .field input, .admin-modal-card .field select {
  padding: 10px 12px; border-radius: 10px; font-size: 0.94rem;
  border: 1px solid var(--line-strong); background: rgba(0, 0, 0, 0.32); color: var(--text); outline: none;
}
.admin-modal-card .field input:focus, .admin-modal-card .field select:focus { border-color: var(--gold); }
.admin-modal-actions { display: flex; gap: 8px; margin-top: 4px; }
.admin-modal-actions .btn { flex: 1; padding: 10px 12px; }
.quick-amounts { display: flex; gap: 5px; flex-wrap: wrap; }
.quick-amounts button {
  flex: 1; min-width: 52px; padding: 7px 6px; border-radius: 8px; font-size: 0.8rem; font-weight: 600;
  border: 1px solid var(--line); background: rgba(255, 255, 255, 0.04); color: var(--muted);
}
.quick-amounts button:hover { color: var(--text); border-color: var(--line-strong); }

@media (max-width: 860px) {
  .admin-table { min-width: 680px; font-size: 0.8rem; }
  .admin-table th, .admin-table td { padding: 7px 8px; }
  .admin-head-actions { width: 100%; }
  .admin-head-actions .btn { flex: 1; }
}

/* карточная раскладка таблицы на телефоне */
@media (max-width: 720px) {
  .admin-table-wrap { overflow: visible; border: 0; border-radius: 0; }
  .admin-table { min-width: 0; width: 100%; display: block; }
  .admin-table thead { display: none; }
  .admin-table tbody { display: flex; flex-direction: column; gap: 8px; }
  .admin-table tr {
    display: grid; grid-template-columns: 1fr auto auto;
    grid-template-areas:
      "name name name"
      "bal coin won"
      "games status status"
      "acts acts acts";
    gap: 6px 10px; padding: 10px 12px; border-radius: 12px;
    background: rgba(255, 255, 255, 0.028); border: 1px solid var(--line);
  }
  .admin-table tr:hover { background: rgba(255, 255, 255, 0.045); }
  .admin-table td { display: block; padding: 0; border: 0; }
  .admin-table td.num, .admin-table td[data-label] { text-align: left; }
  .admin-table td[data-label]::before {
    content: attr(data-label); display: block;
    font-size: 0.56rem; text-transform: uppercase; letter-spacing: 0.07em;
    color: var(--muted); margin-bottom: 1px;
  }
  .admin-table .au-cell-name { grid-area: name; border-bottom: 1px solid var(--line); padding-bottom: 6px; }
  .admin-table td:nth-child(2) { grid-area: bal; }
  .admin-table td:nth-child(3) { grid-area: coin; }
  .admin-table td:nth-child(4) { grid-area: won; }
  .admin-table td:nth-child(5) { grid-area: games; }
  .admin-table td:nth-child(6) { grid-area: status; }
  .admin-table td:nth-child(7) { grid-area: acts; }
  .admin-table .au-name b { max-width: none; font-size: 0.94rem; }
  .admin-acts { justify-content: flex-start; gap: 5px; margin-top: 4px; }
  .mini-btn { padding: 7px 11px; font-size: 0.78rem; }
  .admin-bottom { grid-template-columns: 1fr; }
}

/* ---------- топбар меню / drawer ---------- */
.menu-btn {
  display: none; flex-direction: column; justify-content: center; gap: 4px;
  width: 40px; height: 40px; padding: 0 9px; border-radius: 11px; flex-shrink: 0;
  border: 1px solid var(--line); background: rgba(255, 255, 255, 0.035);
}
.menu-btn span { display: block; height: 2px; border-radius: 2px; background: var(--text); transition: 0.18s; }

.drawer-overlay {
  position: fixed; inset: 0; z-index: 60; background: rgba(4, 7, 6, 0.65);
  backdrop-filter: blur(3px); animation: fadeIn 0.2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.drawer {
  position: fixed; z-index: 61; top: 0; left: 0; bottom: 0; width: min(310px, 84vw);
  background: linear-gradient(170deg, #141b18, #0a0e0c);
  border-right: 1px solid var(--line-strong);
  box-shadow: 24px 0 60px rgba(0, 0, 0, 0.55);
  transform: translateX(-102%);
  transition: transform 0.26s cubic-bezier(0.3, 0.9, 0.3, 1);
  display: flex; flex-direction: column;
  padding: 14px 12px calc(14px + env(safe-area-inset-bottom));
  overflow-y: auto;
}
.drawer.open { transform: none; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 6px 14px; }
.drawer-head .brand-text { letter-spacing: 0.14em; font-size: 0.92rem; font-weight: 800; }
.drawer-head .brand-text em { font-style: normal; color: var(--gold); }
.drawer-close {
  width: 32px; height: 32px; border-radius: 9px; border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04); color: var(--muted); font-size: 0.9rem;
}
.drawer-wallet {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px;
  padding: 10px; border-radius: 13px; margin-bottom: 12px;
  background: rgba(255, 255, 255, 0.035); border: 1px solid var(--line);
}
.dw-item { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.dw-item span { font-size: 0.6rem; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); }
.dw-item b { font-size: 0.85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.drawer-nav { display: flex; flex-direction: column; gap: 4px; }
.dnav {
  display: grid; grid-template-columns: 26px 1fr; grid-template-rows: auto auto;
  gap: 0 10px; align-items: center; text-align: left;
  padding: 10px 11px; border-radius: 12px; border: 1px solid transparent;
  background: transparent; color: var(--text);
}
.dnav span { grid-row: 1 / 3; font-size: 1.15rem; text-align: center; }
.dnav b { font-size: 0.9rem; font-weight: 600; }
.dnav i { font-size: 0.7rem; font-style: normal; color: var(--muted); }
.dnav:hover { background: rgba(255, 255, 255, 0.05); }
.dnav.active {
  background: rgba(244, 201, 93, 0.12); border-color: rgba(244, 201, 93, 0.35);
}
.dnav.active b { color: var(--gold); }

/* ---------- биржа ---------- */
.market-price { display: flex; flex-direction: column; align-items: flex-end; gap: 1px; }
.market-price b { font-size: 1.6rem; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.market-price span { font-size: 0.8rem; font-weight: 700; }
.market-price span.up { color: var(--green); }
.market-price span.down { color: var(--red); }

.market-chart-wrap {
  position: relative; border-radius: 16px; overflow: hidden;
  border: 1px solid var(--line); background: rgba(0, 0, 0, 0.25);
  padding: 10px 10px 6px;
}
#marketChart { display: block; width: 100%; height: clamp(170px, 28vw, 260px); touch-action: pan-y; }
.chart-toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  flex-wrap: wrap; padding: 0 2px 8px;
}
.chart-ranges { display: inline-flex; gap: 3px; padding: 3px; border-radius: 9px; background: rgba(255, 255, 255, 0.04); }
.chart-range {
  border: 0; background: transparent; color: var(--muted); font-weight: 600; font-size: 0.74rem;
  padding: 5px 10px; border-radius: 7px; white-space: nowrap;
}
.chart-range:hover { color: var(--text); }
.chart-range.active { background: rgba(244, 201, 93, 0.16); color: var(--gold); }
.market-detail {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 8px 10px; margin-top: 6px; border-radius: 10px;
  background: rgba(244, 201, 93, 0.07); border: 1px solid rgba(244, 201, 93, 0.22);
  font-size: 0.84rem;
}
.market-detail .md-price { font-weight: 800; color: var(--gold); font-variant-numeric: tabular-nums; }
.market-detail .md-delta { font-weight: 700; font-variant-numeric: tabular-nums; }
.market-detail .md-delta.up { color: var(--green); }
.market-detail .md-delta.down { color: var(--red); }
.market-detail .md-time { font-size: 0.76rem; margin-left: auto; }

.market-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 6px; margin: 12px 0 0; }
.ms-item {
  display: flex; flex-direction: column; gap: 1px; padding: 7px 10px; border-radius: 10px;
  background: rgba(255, 255, 255, 0.028); border: 1px solid var(--line);
}
.ms-item span { font-size: 0.64rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.ms-item b { font-size: 0.9rem; font-variant-numeric: tabular-nums; }
.ms-item b.up { color: var(--green); }
.ms-item b.down { color: var(--red); }

.coin-val { display: inline-flex; flex-direction: column; align-items: flex-end; line-height: 1.2; }
.coin-val b { font-variant-numeric: tabular-nums; font-size: 0.86rem; }
.coin-val span { font-size: 0.68rem; }

.market-legend { display: flex; justify-content: space-between; gap: 10px; padding: 0 4px; }

.market-holdings { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; margin: 14px 0; }
.mh-item {
  display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 12px;
  background: rgba(255, 255, 255, 0.03); border: 1px solid var(--line);
}
.mh-item span { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); }
.mh-item b { font-size: 1rem; font-variant-numeric: tabular-nums; }

.market-trade { border-top: 1px solid var(--line); padding-top: 14px; }
.trade-tabs { display: inline-flex; gap: 4px; padding: 4px; border-radius: 11px; background: rgba(255, 255, 255, 0.04); margin-bottom: 12px; }
.trade-tab {
  border: 0; background: transparent; color: var(--muted); font-weight: 600; font-size: 0.86rem;
  padding: 7px 18px; border-radius: 8px;
}
.trade-tab.active { background: rgba(47, 212, 122, 0.16); color: var(--green); }
.trade-tab[data-action="sell"].active { background: rgba(240, 72, 79, 0.16); color: var(--red); }

/* ---------- кошелёк ---------- */
.wallet-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 16px; align-items: start; }
.wallet-card {
  border: 1px solid var(--line); border-radius: 16px; padding: 16px;
  background: rgba(0, 0, 0, 0.22); display: flex; flex-direction: column; gap: 12px;
}
.wallet-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.wallet-card-head h3 { font-size: 0.98rem; }
.tag {
  font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.07em;
  padding: 3px 8px; border-radius: 999px; color: var(--gold);
  background: rgba(244, 201, 93, 0.1); border: 1px solid rgba(244, 201, 93, 0.28);
}
.wallet-form { display: flex; flex-direction: column; gap: 10px; }
.transfer-preview {
  font-size: 0.8rem; color: var(--muted); padding: 8px 10px; border-radius: 9px;
  background: rgba(255, 255, 255, 0.03); border: 1px dashed var(--line-strong);
}
.limit-bar { display: flex; flex-direction: column; gap: 5px; }
.limit-info { display: flex; justify-content: space-between; gap: 10px; font-size: 0.76rem; color: var(--muted); }
.limit-info b { color: var(--text); font-variant-numeric: tabular-nums; }
.limit-track { height: 6px; border-radius: 99px; background: rgba(255, 255, 255, 0.07); overflow: hidden; }
.limit-track i {
  display: block; height: 100%; width: 0%; border-radius: 99px;
  background: linear-gradient(90deg, #2fd47a, #d9a83a); transition: width 0.3s;
}
.limit-track i.full { background: linear-gradient(90deg, #f0484f, #9d1d24); }

.loan-figures { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.lf {
  display: flex; flex-direction: column; gap: 1px; padding: 9px 11px; border-radius: 11px;
  background: rgba(255, 255, 255, 0.03); border: 1px solid var(--line);
}
.lf span { font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); }
.lf b { font-size: 0.98rem; font-variant-numeric: tabular-nums; }
.red-text { color: var(--red); }
.loan-actions { display: flex; flex-direction: column; gap: 10px; }
.loan-btns { display: flex; gap: 8px; }
.loan-btns .btn { flex: 1; padding: 11px 12px; }
.loan-presets { display: flex; gap: 6px; }
.loan-presets button {
  flex: 1; padding: 8px 6px; border-radius: 9px; font-weight: 700; font-size: 0.84rem;
  border: 1px solid var(--line); background: rgba(255, 255, 255, 0.04); color: var(--muted);
}
.loan-presets button:hover { color: var(--text); border-color: var(--line-strong); }
#loanNew { display: flex; flex-direction: column; gap: 10px; }

.transfer-list { display: flex; flex-direction: column; gap: 6px; max-height: 260px; overflow-y: auto; }
.transfer-list li {
  display: flex; flex-direction: column; gap: 1px; font-size: 0.8rem;
  padding: 8px 10px; border-radius: 9px; background: rgba(255, 255, 255, 0.028);
  border-left: 2px solid var(--gold);
}
.transfer-list li .tl-main { display: flex; justify-content: space-between; gap: 8px; }
.transfer-list li .tl-main b { font-variant-numeric: tabular-nums; }
.transfer-list li .tl-sub { font-size: 0.72rem; color: var(--muted); }

/* метка кредита в рейтинге */
.debt-chip {
  display: inline-flex; align-items: center; gap: 3px; margin-left: 6px;
  font-size: 0.64rem; font-weight: 700; padding: 1px 5px; border-radius: 5px;
  color: var(--red); background: rgba(240, 72, 79, 0.12); border: 1px solid rgba(240, 72, 79, 0.3);
  white-space: nowrap;
}
.debt-chip.ok { color: var(--gold); background: rgba(244, 201, 93, 0.1); border-color: rgba(244, 201, 93, 0.28); }

/* ---------- удача ---------- */
.luck-box {
  margin-top: 14px; padding: 12px 14px; border-radius: 14px;
  background: linear-gradient(150deg, rgba(47, 212, 122, 0.07), rgba(240, 72, 79, 0.05));
  border: 1px solid var(--line);
}
.luck-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.luck-head span { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.09em; color: var(--muted); }
.luck-head b { font-size: 0.92rem; color: var(--gold); }
.luck-track {
  position: relative; height: 10px; border-radius: 99px; overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.45);
}
.luck-track i {
  position: absolute; top: 0; bottom: 0; width: 0; left: 0;
  background: linear-gradient(90deg, #f0484f, #d9a83a 45%, #2fd47a);
  border-radius: 99px; transition: width 0.45s cubic-bezier(0.3, 0.9, 0.3, 1);
}
.luck-track u {
  position: absolute; top: -3px; bottom: -3px; width: 2px; left: 50%;
  background: rgba(255, 255, 255, 0.55); border-radius: 2px; text-decoration: none;
}
.luck-foot { display: flex; justify-content: space-between; gap: 10px; margin-top: 6px; font-size: 0.76rem; color: var(--muted); }
.luck-foot #luckRtp { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.luck-box p { margin-top: 8px; line-height: 1.35; }

.luck-note {
  font-size: 0.78rem; padding: 7px 10px; border-radius: 9px; margin-top: 2px;
  background: rgba(244, 201, 93, 0.09); border: 1px solid rgba(244, 201, 93, 0.25); color: var(--gold);
}
.luck-note.good { background: var(--green-soft); border-color: rgba(47, 212, 122, 0.3); color: #b8f7d4; }

.luck-val { display: inline-flex; align-items: center; gap: 5px; font-variant-numeric: tabular-nums; }
.luck-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

/* ---------- лидеры ---------- */
.leader-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; }
.leader-card { border: 1px solid var(--line); border-radius: 16px; background: rgba(0, 0, 0, 0.22); overflow: hidden; }
.leader-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 14px 16px 10px; }
.leader-head h3 { font-size: 1rem; }
.leader-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.leader-table th {
  text-align: left; font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.09em;
  color: var(--muted); font-weight: 600; padding: 6px 16px; border-bottom: 1px solid var(--line);
}
.leader-table th.num, .leader-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.leader-table td { padding: 9px 16px; border-bottom: 1px solid rgba(255, 255, 255, 0.045); }
.leader-table tr:last-child td { border-bottom: 0; }
.leader-table tbody tr.me { background: rgba(244, 201, 93, 0.09); }
.leader-table tbody tr.me td:first-child { box-shadow: inset 3px 0 0 var(--gold); }
.leader-rank {
  display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%;
  font-size: 0.72rem; font-weight: 800; background: rgba(255, 255, 255, 0.07); color: var(--muted);
}
.leader-table tr:nth-child(1) .leader-rank { background: linear-gradient(150deg, #f7e3a8, #d9a83a); color: #20190a; }
.leader-table tr:nth-child(2) .leader-rank { background: linear-gradient(150deg, #e6eaea, #9aa8a3); color: #1a201d; }
.leader-table tr:nth-child(3) .leader-rank { background: linear-gradient(150deg, #e3ab7a, #a4693c); color: #201409; }
.leader-name { display: flex; align-items: center; gap: 8px; min-width: 0; }
.leader-name b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.leader-you { font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--gold); border: 1px solid rgba(244, 201, 93, 0.35); border-radius: 5px; padding: 1px 5px; }
.leader-sub { font-size: 0.68rem; color: var(--muted); margin-top: 2px; }
.leaders-note { margin-top: 14px; }
.btn-refresh { padding: 8px 16px; font-size: 0.85rem; }

/* ---------- roulette ---------- */
.roulette-wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: center; }
.wheel-box { position: relative; display: grid; place-items: center; padding: 14px 0 6px; }
#wheelCanvas {
  width: clamp(240px, 30vw, 310px); height: auto; aspect-ratio: 1; border-radius: 50%;
  will-change: transform;
  box-shadow: 0 0 0 6px #1c1510, 0 0 0 8px rgba(244, 201, 93, 0.35), 0 24px 50px rgba(0, 0, 0, 0.55);
}
.wheel-pointer {
  position: absolute; top: 6px; left: 50%; transform: translateX(-50%); z-index: 3;
  width: 0; height: 0; border-left: 9px solid transparent; border-right: 9px solid transparent;
  border-top: 18px solid var(--gold); filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.7));
}
.roulette-side { display: flex; flex-direction: column; gap: 14px; }
.roulette-result {
  display: grid; place-items: center; min-height: 88px; border-radius: 14px; padding: 12px;
  background: rgba(0, 0, 0, 0.28); border: 1px solid var(--line);
}
.roulette-result .rnum {
  width: 62px; height: 62px; border-radius: 50%; display: grid; place-items: center;
  font-size: 1.7rem; font-weight: 800; color: #fff; animation: pop 0.35s ease;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}
.rnum.red { background: linear-gradient(160deg, #e2454c, #9d1d24); }
.rnum.black { background: linear-gradient(160deg, #2b3230, #101413); border: 1px solid var(--line-strong); }
.rnum.green { background: linear-gradient(160deg, #2fd47a, #158a4a); color: #06170d; }
.roulette-result .rtext { margin-top: 8px; font-size: 0.9rem; font-weight: 600; }
.roulette-result .rtext .green-text { color: var(--green); }
.roulette-result .rtext .red-text { color: var(--red); }
.last-numbers { display: flex; flex-wrap: wrap; gap: 6px; min-height: 30px; }
.last-numbers i {
  font-style: normal; width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center; font-size: 0.76rem; font-weight: 700;
  animation: pop 0.3s ease;
}
.last-numbers i.red { background: #9d1d24; }
.last-numbers i.black { background: #222927; border: 1px solid var(--line-strong); }
.last-numbers i.green { background: #158a4a; }
.color-bets { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.color-btn {
  border-radius: 12px; padding: 12px 10px; font-weight: 700; color: #fff;
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  border: 1px solid var(--line-strong); transition: transform 0.12s, filter 0.15s;
}
.color-btn:active { transform: translateY(1px); }
.color-btn.red { background: linear-gradient(160deg, #d63a41, #8f161d); }
.color-btn.black { background: linear-gradient(160deg, #2b3230, #0f1211); }
.color-btn.green { grid-column: 1 / -1; background: linear-gradient(160deg, #28b96b, #106b3a); color: #04140a; }
.color-btn b { font-size: 0.78rem; opacity: 0.85; }
.color-btn:disabled { opacity: 0.5; }

/* ---------- profile ---------- */
.guest-badge {
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.1em;
  padding: 5px 10px; border-radius: 999px; color: var(--gold);
  border: 1px solid rgba(244, 201, 93, 0.3); background: rgba(244, 201, 93, 0.08);
}
.profile-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 18px; }
.profile-card {
  border: 1px solid var(--line); border-radius: 16px; padding: 18px;
  background: rgba(0, 0, 0, 0.22);
}
.profile-id { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.stat {
  display: flex; flex-direction: column; gap: 2px; padding: 10px 12px;
  border-radius: 11px; background: rgba(255, 255, 255, 0.03); border: 1px solid var(--line);
}
.stat span { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); }
.stat b { font-size: 1.02rem; }
#statProfit.positive { color: var(--green); }
#statProfit.negative { color: var(--red); }
.profile-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }

.auth-tabs { display: flex; gap: 4px; margin-bottom: 14px; background: rgba(255, 255, 255, 0.04); padding: 4px; border-radius: 11px; }
.auth-tab {
  flex: 1; border: 0; background: transparent; color: var(--muted); padding: 8px;
  border-radius: 8px; font-weight: 600; font-size: 0.88rem;
}
.auth-tab.active { background: rgba(244, 201, 93, 0.15); color: var(--gold); }
.auth-form { display: flex; flex-direction: column; gap: 10px; }
.auth-form p { font-size: 0.85rem; margin-bottom: 2px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field > span { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); }
.auth-form .btn { margin-top: 6px; }

/* ---------- sidebar ---------- */
.sidebar { display: flex; flex-direction: column; gap: 14px; position: sticky; top: 82px; }
.side-card {
  background: linear-gradient(170deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line); border-radius: 16px; padding: 14px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.3);
}
.side-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.side-head h3 { font-size: 0.86rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 0 rgba(47, 212, 122, 0.5); animation: live 1.8s infinite; }
@keyframes live {
  0% { box-shadow: 0 0 0 0 rgba(47, 212, 122, 0.45); }
  70% { box-shadow: 0 0 0 8px rgba(47, 212, 122, 0); }
  100% { box-shadow: 0 0 0 0 rgba(47, 212, 122, 0); }
}
.online-count {
  font-weight: 800; color: var(--green); font-size: 0.95rem; min-width: 28px; text-align: center;
  background: var(--green-soft); border-radius: 999px; padding: 2px 9px;
}
.online-list { display: flex; flex-wrap: wrap; gap: 6px; max-height: 128px; overflow-y: auto; }
.online-list li {
  font-size: 0.8rem; padding: 4px 9px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line);
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.online-list li.me { border-color: rgba(244, 201, 93, 0.4); color: var(--gold); }

.feed-list, .chat-list { display: flex; flex-direction: column; gap: 7px; max-height: 220px; overflow-y: auto; scrollbar-width: thin; }
.feed-list li {
  font-size: 0.8rem; padding: 7px 9px; border-radius: 9px; background: rgba(255, 255, 255, 0.028);
  border-left: 2px solid var(--gold); display: flex; flex-direction: column; gap: 1px;
}
.feed-list li .fname { font-weight: 600; }
.feed-list li .fwin { color: var(--green); font-weight: 700; }
.feed-list li .fmeta { color: var(--muted); font-size: 0.74rem; }
.feed-list li.big { border-left-color: var(--red); background: rgba(240, 72, 79, 0.06); }

.chat-card { display: flex; flex-direction: column; gap: 8px; }
.chat-list li { font-size: 0.82rem; line-height: 1.35; word-break: break-word; }
.chat-list li .cname { color: var(--gold); font-weight: 600; margin-right: 5px; }
.chat-list li.system { color: var(--muted); font-size: 0.76rem; font-style: italic; }
.chat-form { display: flex; gap: 6px; }
.chat-form input {
  flex: 1; min-width: 0; padding: 9px 11px; border-radius: 9px; font-size: 0.85rem;
  border: 1px solid var(--line-strong); background: rgba(0, 0, 0, 0.3); color: var(--text); outline: none;
}
.chat-form input:focus { border-color: var(--gold); }
.chat-form button {
  width: 38px; border-radius: 9px; border: 1px solid var(--line-strong);
  background: rgba(244, 201, 93, 0.14); color: var(--gold); font-size: 0.95rem;
}

/* ---------- toasts ---------- */
.toasts { position: fixed; z-index: 90; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast {
  min-width: 200px; max-width: 320px; padding: 11px 14px; border-radius: 12px;
  background: rgba(18, 24, 22, 0.96); border: 1px solid var(--line-strong);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.5); font-size: 0.88rem;
  animation: toastIn 0.25s ease;
}
.toast.win { border-color: rgba(47, 212, 122, 0.5); color: #b8f7d4; }
.toast.error { border-color: rgba(240, 72, 79, 0.5); color: #ffc4c6; }
.toast.out { animation: toastOut 0.25s ease forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(8px); } }

/* ---------- footer ---------- */
.footer {
  position: relative; z-index: 1; display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 22px 16px 26px; color: #5f6d66; font-size: 0.76rem; text-align: center;
}
.conn { color: var(--green); }
.conn.off { color: var(--red); }

/* спрятанная кнопка бонуса */
.secret-btn {
  position: relative; width: 22px; height: 22px; padding: 0; margin-left: 2px;
  border: 0; background: transparent; color: #5f6d66; font-size: 1.1rem; line-height: 1;
  opacity: 0.28; cursor: default; transition: opacity 0.25s, color 0.25s, transform 0.25s;
  border-radius: 50%;
}
.secret-btn:hover, .secret-btn:focus-visible {
  opacity: 1; color: var(--gold); transform: scale(1.35); cursor: pointer;
  outline: none; text-shadow: 0 0 12px rgba(244, 201, 93, 0.8);
}
.secret-btn:active { transform: scale(1.1); }
.secret-btn.ready { color: var(--gold); opacity: 0.55; animation: secretPulse 2.6s ease-in-out infinite; }
@keyframes secretPulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 0.85; }
}

/* всплывающее объявление фазы */
.phase-flash {
  position: fixed; inset: 0; z-index: 95; display: grid; place-items: center;
  pointer-events: none; padding: 20px;
}
.phase-flash-inner {
  text-align: center; animation: phaseIn 0.5s cubic-bezier(0.2, 1.3, 0.4, 1);
}
.phase-flash .pf-title {
  font-size: clamp(1.6rem, 6vw, 3rem); font-weight: 800; letter-spacing: 0.02em;
  background: linear-gradient(96deg, #ffe9a8, #f4c95d 40%, #fff6d6 60%, #e0ac3c);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 6px 30px rgba(244, 201, 93, 0.55));
}
.phase-flash .pf-sub {
  margin-top: 8px; font-size: clamp(1rem, 3.4vw, 1.5rem); font-weight: 800; color: var(--green);
  text-shadow: 0 0 26px rgba(47, 212, 122, 0.6);
}
.phase-flash.out .phase-flash-inner { animation: phaseOut 0.45s ease forwards; }
@keyframes phaseIn {
  0% { opacity: 0; transform: scale(0.82) translateY(14px); }
  100% { opacity: 1; transform: none; }
}
@keyframes phaseOut {
  to { opacity: 0; transform: scale(1.06) translateY(-12px); }
}


/* ---------- scrollbars ---------- */
* { scrollbar-color: rgba(255, 255, 255, 0.18) transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.16); border-radius: 99px; }

/* ---------- responsive ---------- */
@media (max-width: 1080px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: static; display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
  .chat-list { max-height: 160px; }
  .mines-layout { grid-template-columns: 1fr; }
  .mines-side { max-width: 520px; margin: 0 auto; width: 100%; }
}
@media (max-width: 860px) {
  .topbar { gap: 8px; padding: 9px 12px; }
  .menu-btn { display: flex; }
  .tabs { display: none; }
  .wallet { gap: 5px; margin-left: auto; }
  .chip { min-width: 0; padding: 4px 8px; border-radius: 10px; }
  .chip-label { font-size: 0.56rem; letter-spacing: 0.06em; }
  .chip b { font-size: 0.85rem; }
  .chip-win { display: none; }
  .user-name { display: none; }
  .user-btn { padding: 4px; }
  .brand-text { font-size: 0.84rem; letter-spacing: 0.1em; }
  .roulette-wrap { grid-template-columns: 1fr; }
  .wheel-box { order: -1; }
  .btn-spin, .btn-crash { margin-left: 0; width: 100%; }
  .presets { width: 100%; }
  .presets button { flex: 1; min-width: 0; }
  .crash-history { justify-content: flex-start; max-width: none; }
  .panel-head { flex-direction: column; gap: 8px; }
  .layout { padding: 14px 12px 6px; gap: 14px; }
  .panel { padding: 14px; border-radius: 15px; }
  .panel-head h2 { font-size: 1.18rem; }
  .market-price { align-items: flex-start; }
  .auto-stop { width: 100%; height: 42px; justify-content: space-between; }
  .bet-row { gap: 8px; }
  .bet-field { min-width: 0; flex: 1 1 100%; }
  .slots-extra { gap: 8px; }
  .btn-auto { flex: 1; }
  .mines-stats { grid-template-columns: 1fr 1fr; }
  .wallet-grid { grid-template-columns: 1fr; }
  .loan-figures { grid-template-columns: 1fr 1fr; }
  .leader-grid { grid-template-columns: 1fr; }
  .footer { font-size: 0.68rem; padding: 16px 12px 22px; }
}
@media (max-width: 480px) {
  .brand-text { display: none; }
  .brand-mark { width: 34px; height: 34px; }
  .stats { grid-template-columns: 1fr; }
  .side-card { padding: 12px; }
  .toasts { left: 12px; right: 12px; bottom: 12px; }
  .toast { max-width: none; }
  .leader-table th, .leader-table td { padding-left: 10px; padding-right: 10px; }
  .slot-modes .mode-btn { flex: 1; justify-content: center; padding: 8px 6px; font-size: 0.78rem; }
  .mode-btn span { display: none; }
  .mines-counts button { min-width: 0; }
  .loan-btns { flex-direction: column; }
  .market-price b { font-size: 1.35rem; }
}
