/* ════════════════════════════════════════════
   NEON CHROME — Mini App
   Язык RIVER: почти чёрный, волосяные линии, хром.
   Неон — только тонкие линии, кометы и точки.
   ════════════════════════════════════════════ */

:root {
  --bg-0: #0a0a0b;
  --bg-1: #101012;
  --bg-2: #18181b;
  --grid: #1a1a1d;
  --line: #2a2a2e;
  --line-strong: #3a3a3f;
  --white: #f4f4f6;
  --text: #f4f4f6;
  --muted: #a0a0a6;
  --text-dim: #6e6e74;
  --text-faint: #4a4a50;
  --ink: #0a0a0b;

  --chrome: linear-gradient(55deg, #fafafc 0%, #94949a 30%, #ececf0 52%, #64646a 76%, #d6d6dc 100%);
  --chrome-soft: linear-gradient(55deg, #d6d6dc 0%, #76767c 30%, #c8c8ce 52%, #505056 76%, #b4b4ba 100%);
  --chrome-v: linear-gradient(180deg, #ffffff 0%, #d6d6dc 30%, #8a8a90 50%, #ececf0 56%, #a8a8ae 82%, #f4f4f6 100%);

  /* неон — только для линий и точек */
  --cyan: #00e5ff;
  --magenta: #ff10b4;
  --lime: #a6ff3a;
  --red: #ff1a3d;
  --violet: #a35cff;

  --r-sm: 8px;
  --r: 12px;
  --r-lg: 14px;
  --hair: 1px;
  --accent-line: 1.25px;

  --f-head: 'Unbounded', 'Manrope', system-ui, sans-serif;
  --f-body: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --f-mono: 'JetBrains Mono', ui-monospace, Consolas, monospace;

  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --safe-top: calc(var(--tg-safe-area-inset-top, 0px) + var(--tg-content-safe-area-inset-top, 0px));
  --safe-bottom: max(env(safe-area-inset-bottom, 0px), var(--tg-safe-area-inset-bottom, 0px));
  --vh: var(--tg-viewport-stable-height, 100dvh);
  --tabbar-h: 62px;
  --gutter: 16px;
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  background: radial-gradient(1100px 620px at 50% -12%, #151518 0%, var(--bg-0) 62%) fixed, var(--bg-0);
  color: var(--text);
  font-family: var(--f-body);
  font-size: 15px;
  line-height: 1.4;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  user-select: none;
  -webkit-user-select: none;
}
input, textarea { user-select: text; -webkit-user-select: text; }
button { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }

/* ─────────── утилиты стиля ─────────── */
.chrome-text {
  background: var(--chrome);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}
.chrome-v { background: var(--chrome-v); -webkit-background-clip: text; background-clip: text; color: transparent; }
.chrome-outline {
  border: var(--accent-line) solid transparent;
  background: linear-gradient(var(--bg-1), var(--bg-1)) padding-box, var(--chrome) border-box;
}
/* тонкая неоновая линия: затухает к краям, светится чуть-чуть */
.neon-line { height: 1px; background: linear-gradient(90deg, transparent, var(--nc, var(--cyan)) 40%, var(--nc, var(--cyan)) 60%, transparent); box-shadow: 0 0 6px var(--nc, var(--cyan)); opacity: .85; }

/* орбита-комета (как кольца в RIVER) */
.orbit { position: absolute; border-radius: 50%; border: 1px solid var(--grid); pointer-events: none; }
.orbit .comet {
  position: absolute; inset: -1px; border-radius: 50%;
  background: conic-gradient(from 0deg, transparent 0 82%, color-mix(in srgb, var(--oc, #fafafc) 14%, transparent) 90%, color-mix(in srgb, var(--oc, #fafafc) 85%, transparent) 100%);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 1.25px), #000 calc(100% - 1px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 1.25px), #000 calc(100% - 1px));
  animation: spin var(--period, 24s) linear infinite;
}
.orbit .comet::after {
  content: ''; position: absolute; top: -0.5px; left: 50%; width: 3px; height: 3px; margin-left: -1.5px; border-radius: 50%;
  background: color-mix(in srgb, var(--oc, #fff) 45%, white);
  box-shadow: 0 0 6px var(--oc, #fff), 0 0 14px color-mix(in srgb, var(--oc, #fff) 50%, transparent);
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─────────── оболочка ─────────── */
.app { position: relative; z-index: 1; display: flex; height: var(--vh); }
.shell { flex: 1; min-width: 0; display: flex; flex-direction: column; height: 100%; }
.main {
  flex: 1; overflow-y: auto; overflow-x: hidden;
  padding: 14px var(--gutter) calc(var(--tabbar-h) + var(--safe-bottom) + 20px);
  scrollbar-width: thin; scrollbar-color: var(--line) transparent;
  overscroll-behavior: contain;
}
.main > .view { max-width: 1180px; margin: 0 auto; animation: viewIn .32s var(--ease) both; }
@keyframes viewIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.topbar {
  display: flex; align-items: center; gap: 12px;
  padding: calc(var(--safe-top) + 10px) var(--gutter) 10px;
  border-bottom: 1px solid var(--line);
  background: rgba(10, 10, 11, 0.92);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  position: relative; z-index: 5;
}
.topbar .who { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; cursor: pointer; }
.avatar {
  width: 38px; height: 38px; border-radius: 50%; flex: none; position: relative;
  display: grid; place-items: center;
  font-family: var(--f-head); font-weight: 500; font-size: 13px; letter-spacing: .04em;
  border: var(--accent-line) solid transparent;
  background: linear-gradient(var(--bg-2), var(--bg-2)) padding-box, var(--chrome) border-box;
}
.avatar span { background: var(--chrome); -webkit-background-clip: text; background-clip: text; color: transparent; }
.avatar .orbit { inset: -5px; border-color: transparent; }
.who-text { min-width: 0; }
.who-name { font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who-lvl { display: flex; align-items: center; gap: 8px; font-family: var(--f-mono); font-size: 10px; color: var(--text-dim); letter-spacing: .14em; }
.xpbar { width: 72px; height: 1px; background: var(--line); position: relative; }
.xpbar i { position: absolute; left: 0; top: -0.5px; height: 2px; background: linear-gradient(90deg, transparent, var(--violet)); border-radius: 2px; transition: width .6s var(--ease); }
.xpbar i::after { content: ''; position: absolute; right: -1px; top: -1px; width: 4px; height: 4px; border-radius: 50%; background: #e9d9ff; box-shadow: 0 0 6px var(--violet); }
.balance-pill {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 13px 7px 11px; border-radius: 999px;
  border: var(--accent-line) solid transparent;
  background: linear-gradient(var(--bg-1), var(--bg-1)) padding-box, var(--chrome-soft) border-box;
  font-family: var(--f-mono); font-weight: 700; font-size: 14px; cursor: pointer; white-space: nowrap;
}
.balance-pill .chip-ico { color: var(--muted); font-size: 12px; }
.balance-pill.up { animation: balUp .9s var(--ease); }
.balance-pill.down { animation: balDown .6s var(--ease); }
@keyframes balUp { 25% { background: linear-gradient(var(--bg-1), var(--bg-1)) padding-box, linear-gradient(90deg, var(--lime), var(--lime)) border-box; } }
@keyframes balDown { 25% { background: linear-gradient(var(--bg-1), var(--bg-1)) padding-box, linear-gradient(90deg, var(--red), var(--red)) border-box; } }

/* нижние вкладки (телефон) */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0;
  display: grid; grid-template-columns: repeat(4, 1fr);
  height: calc(var(--tabbar-h) + var(--safe-bottom)); padding-bottom: var(--safe-bottom);
  background: rgba(10, 10, 11, 0.96); border-top: 1px solid var(--line);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  z-index: 20;
}
.tab {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
  background: none; border: 0; color: var(--text-dim);
  font-family: var(--f-mono); font-size: 9.5px; letter-spacing: .18em; text-transform: uppercase;
  position: relative; cursor: pointer; transition: color .2s;
}
.tab svg { width: 21px; height: 21px; stroke-width: 1.4; }
.tab.active { color: var(--white); }
.tab.active::before { content: ''; position: absolute; top: -1px; left: 30%; right: 30%; height: 1px; background: linear-gradient(90deg, transparent, var(--cyan), transparent); box-shadow: 0 0 6px var(--cyan); }
.tab .dot { position: absolute; top: 11px; right: calc(50% - 16px); width: 5px; height: 5px; border-radius: 50%; background: #ffd1f1; box-shadow: 0 0 6px var(--magenta); }
.sidenav { display: none; }

/* ─────────── типографика ─────────── */
.h1 { font-family: var(--f-head); font-weight: 400; font-size: clamp(26px, 7.5vw, 44px); line-height: 1.04; letter-spacing: .12em; text-transform: uppercase; margin: 0; }
.h2 { font-family: var(--f-head); font-weight: 500; font-size: 18px; text-transform: uppercase; letter-spacing: .12em; margin: 0; }
.h3 { font-family: var(--f-head); font-weight: 500; font-size: 13px; text-transform: uppercase; letter-spacing: .1em; margin: 0; }
.label { font-family: var(--f-mono); font-size: 10px; letter-spacing: .22em; text-transform: uppercase; color: var(--text-dim); }
.mono { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
.dim { color: var(--text-dim); }
.muted { color: var(--muted); }
.faint { color: var(--text-faint); }
.c-cyan { color: var(--cyan); }
.c-magenta { color: var(--magenta); }
.c-lime { color: var(--lime); }
.c-red { color: var(--red); }
.c-violet { color: var(--violet); }

.section-head { display: flex; align-items: center; gap: 12px; margin: 24px 0 12px; }
.section-head .rule { flex: 1; height: 1px; background: linear-gradient(90deg, var(--line), transparent); }
.rule-dot { position: relative; height: 1px; background: linear-gradient(90deg, transparent, var(--line) 20%, var(--line)); margin: 14px 0; }
.rule-dot::after { content: ''; position: absolute; right: 0; top: -1.5px; width: 4px; height: 4px; border-radius: 50%; background: #d9fbff; box-shadow: 0 0 6px var(--cyan); }

/* ─────────── карточки ─────────── */
.card { background: var(--bg-1); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; position: relative; }
.card.accent::before {
  content: ''; position: absolute; left: 16px; top: -1px; width: 72px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent, var(--cyan)), transparent);
  box-shadow: 0 0 6px var(--accent, var(--cyan));
}
.card.chrome-edge { border: var(--accent-line) solid transparent; background: linear-gradient(var(--bg-1), var(--bg-1)) padding-box, var(--chrome-soft) border-box; }
.hud { position: relative; }
.hud::after {
  content: ''; position: absolute; right: 14px; bottom: -1px; width: 40px; height: 1px; pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.45));
}

/* ─────────── кнопки ─────────── */
.btn {
  appearance: none; position: relative; overflow: hidden;
  border: var(--accent-line) solid transparent; border-radius: 10px;
  background: linear-gradient(var(--bg-1), var(--bg-1)) padding-box, var(--chrome) border-box;
  color: var(--white); padding: 12px 16px; min-height: 44px;
  font-family: var(--f-body); font-weight: 800; font-size: 12px; letter-spacing: .16em; text-transform: uppercase;
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap;
  transition: transform .08s, background .2s, opacity .2s, color .2s;
}
.btn:hover { background: linear-gradient(var(--bg-2), var(--bg-2)) padding-box, var(--chrome) border-box; }
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: .38; pointer-events: none; }
.btn.block { width: 100%; }
.btn.sm { min-height: 34px; padding: 7px 12px; font-size: 10.5px; border-radius: 9px; }
.btn svg { width: 17px; height: 17px; flex: none; stroke-width: 1.5; }
/* главная — белая с тёмным текстом */
.btn.primary, .btn.chrome, .btn.neon {
  background: var(--white) padding-box; border-color: var(--white); color: var(--ink);
}
.btn.primary:hover, .btn.chrome:hover, .btn.neon:hover { background: #ffffff padding-box; box-shadow: 0 0 0 1px rgba(255,255,255,.25); }
/* «забрать» — белая + бегущая неоновая нить снизу */
.btn.lime { background: var(--white) padding-box; border-color: var(--white); color: var(--ink); }
.btn.lime::after, .btn.pulse::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 2px;
  background: linear-gradient(90deg, transparent 0%, var(--lc, var(--lime)) 45%, var(--lc, var(--lime)) 55%, transparent 100%);
  background-size: 50% 100%; background-repeat: no-repeat;
  animation: sweep 1.6s linear infinite;
}
.btn.neon.pulse { --lc: var(--cyan); }
@keyframes sweep { from { background-position: -60% 0; } to { background-position: 160% 0; } }
.btn.ghost { background: transparent; border: 1px solid var(--line); color: var(--muted); }
.btn.ghost:hover { border-color: var(--line-strong); color: var(--white); background: transparent; }
.btn.red { background: transparent; border: 1px solid rgba(255,26,61,.5); color: var(--red); }
.btn.red:hover { border-color: var(--red); background: rgba(255,26,61,.08); }
.btn.magenta { --lc: var(--magenta); }
.btn .sub { font-family: var(--f-mono); font-weight: 600; font-size: 11px; letter-spacing: .02em; text-transform: none; opacity: .75; }

.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 3px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg-1); }
.seg button { border: 1px solid transparent; background: transparent; color: var(--text-dim); padding: 8px 6px; border-radius: 7px; cursor: pointer; font-family: var(--f-mono); font-size: 10.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; white-space: nowrap; transition: color .2s; }
.seg button.on { color: var(--white); border: var(--accent-line) solid transparent; background: linear-gradient(var(--bg-2), var(--bg-2)) padding-box, var(--chrome) border-box; }
.seg.scroll { display: flex; overflow-x: auto; scrollbar-width: none; }
.seg.scroll::-webkit-scrollbar { display: none; }
.seg.scroll button { flex: none; padding: 8px 12px; }

/* ─────────── поля ─────────── */
.field { display: flex; flex-direction: column; gap: 7px; }
.input-wrap { display: flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg-0); padding: 4px 4px 4px 12px; transition: border-color .2s; position: relative; }
.input-wrap:focus-within { border-color: var(--line-strong); }
.input-wrap:focus-within::after { content: ''; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 1px; background: linear-gradient(90deg, transparent, var(--cyan), transparent); box-shadow: 0 0 6px var(--cyan); }
.input-wrap input { flex: 1; min-width: 0; background: transparent; border: 0; outline: 0; color: var(--white); font-family: var(--f-mono); font-size: 16px; font-weight: 700; padding: 8px 0; }
.input-wrap .suffix { font-family: var(--f-mono); color: var(--text-dim); font-size: 13px; padding-right: 6px; }
.mini-btn { border: 1px solid var(--line); background: var(--bg-1); color: var(--muted); border-radius: 7px; font-family: var(--f-mono); font-size: 11.5px; font-weight: 700; padding: 8px 10px; cursor: pointer; min-width: 40px; transition: color .15s, border-color .15s; }
.mini-btn:hover { color: var(--white); border-color: var(--line-strong); }
.mini-btn:active { transform: scale(.96); }
.quick { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }

/* ─────────── лобби ─────────── */
.hero {
  position: relative; overflow: hidden; isolation: isolate;
  border: 1px solid var(--line); border-radius: 16px; background: var(--bg-1);
  padding: 26px 20px 22px; margin-bottom: 14px;
}
.hero .rings { position: absolute; right: 64px; top: 46%; width: 0; height: 0; z-index: -1; opacity: .9; }
.hero .rings .orbit { transform: translate(-50%, -50%); left: 0; top: 0; }
.hero .h1 { margin: 10px 0 10px; }
.hero p { margin: 0; color: var(--muted); font-size: 13px; max-width: 380px; }
.hero .hero-actions { display: flex; gap: 8px; margin-top: 18px; flex-wrap: wrap; }

.games-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.tile {
  position: relative; overflow: hidden; border-radius: var(--r);
  border: 1px solid var(--line); background: var(--bg-1);
  padding: 14px; min-height: 124px; cursor: pointer;
  display: flex; flex-direction: column; justify-content: space-between;
  transition: transform .1s, background .25s;
}
.tile:hover { background: linear-gradient(var(--bg-1), var(--bg-1)) padding-box, var(--chrome-soft) border-box; border: var(--accent-line) solid transparent; padding: 13.75px; }
.tile:active { transform: scale(.985); }
.tile .ico { width: 34px; height: 34px; color: #d6d6dc; }
.tile .ico svg { width: 100%; height: 100%; stroke-width: 1.3; }
.tile .name { font-family: var(--f-head); font-weight: 500; font-size: 12px; text-transform: uppercase; letter-spacing: .12em; margin-top: 12px; }
.tile .sub { font-size: 12px; color: var(--text-dim); margin-top: 3px; }
.tile::before {
  content: ''; position: absolute; left: 14px; bottom: 0; width: 34px; height: 1px;
  background: var(--tile-c, var(--cyan)); box-shadow: 0 0 6px var(--tile-c, var(--cyan));
  transition: width .35s var(--ease);
}
.tile:hover::before { width: 64px; }
.tile .tag { position: absolute; top: 12px; right: 12px; font-family: var(--f-mono); font-size: 9.5px; letter-spacing: .14em; color: var(--text-dim); border: 1px solid var(--line); border-radius: 999px; padding: 3px 8px; }
.tile .tag.live { color: var(--white); }
.tile .tag.live::before { content: ''; display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: #eaffd0; box-shadow: 0 0 6px var(--lime); margin-right: 6px; vertical-align: 1px; animation: blink 1.4s infinite; }
@keyframes blink { 50% { opacity: .25; } }
.tile.wide { grid-column: span 2; min-height: 148px; }
.tile .bigx { font-family: var(--f-head); font-weight: 500; font-size: 34px; letter-spacing: .02em; margin-top: 26px; }

.banner {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--r);
  border: 1px solid var(--line); background: var(--bg-1); margin-bottom: 10px; cursor: pointer; position: relative; overflow: hidden;
}
.banner::before { content: ''; position: absolute; left: 0; top: 10px; bottom: 10px; width: 1px; background: var(--bc, var(--magenta)); box-shadow: 0 0 6px var(--bc, var(--magenta)); }
.banner .t { flex: 1; font-size: 13px; color: var(--muted); }
.banner b { color: var(--white); font-family: var(--f-mono); }

/* ─────────── игровой экран ─────────── */
.game-head { display: flex; align-items: center; gap: 12px; margin: 2px 0 14px; }
.game-head .back { width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg-1); display: grid; place-items: center; cursor: pointer; color: var(--muted); flex: none; }
.game-head .back:hover { color: var(--white); border-color: var(--line-strong); }
.game-head .back svg { width: 18px; height: 18px; }
.game-head .h2 { flex: 1; }
.game-head .info { font-family: var(--f-mono); font-size: 9.5px; letter-spacing: .16em; color: var(--text-dim); border: 1px solid var(--line); padding: 6px 10px; border-radius: 999px; cursor: pointer; background: none; }
.game { display: grid; gap: 12px; }
.stage {
  position: relative; border: 1px solid var(--line); border-radius: 14px; overflow: hidden;
  background: radial-gradient(520px 300px at 50% 0%, #141417, var(--bg-1) 70%);
  min-height: 260px; transition: border-color .3s;
}
.stage canvas { display: block; width: 100%; }
.controls { display: flex; flex-direction: column; gap: 12px; }
.controls .row { display: flex; gap: 8px; }
.controls .row > * { flex: 1; }
.kv { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-size: 13px; color: var(--muted); }
.kv .v { font-family: var(--f-mono); font-weight: 700; color: var(--white); }

.result-flash {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) scale(.9);
  font-family: var(--f-head); font-weight: 500; font-size: clamp(30px, 9vw, 54px); letter-spacing: .04em;
  opacity: 0; pointer-events: none; text-align: center; white-space: nowrap; z-index: 4;
  background: var(--chrome-v); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 4px 14px rgba(0,0,0,.8));
  --fc: #ffffff;
}
.result-flash::after { content: ''; display: block; height: 1px; width: 70%; margin: 8px auto 0; background: linear-gradient(90deg, transparent, var(--fc), transparent); box-shadow: 0 0 6px var(--fc); }
.result-flash.c-lime { --fc: var(--lime); color: transparent; }
.result-flash.c-magenta { --fc: var(--magenta); color: transparent; }
.result-flash.c-red { --fc: var(--red); color: transparent; }
.result-flash.dim { --fc: #8a8a90; color: transparent; }
.result-flash.show { animation: flash 1.6s var(--ease) forwards; }
@keyframes flash { 0% { opacity: 0; transform: translate(-50%,-50%) scale(.85); } 15% { opacity: 1; transform: translate(-50%,-50%) scale(1); } 80% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%,-56%) scale(1); } }
.stage.win { animation: stageWin 1s var(--ease); }
.stage.lose { animation: stageLose .45s ease; }
.stage.jackpot { animation: stageJackpot 1.6s var(--ease); }
@keyframes stageWin { 20%, 60% { border-color: color-mix(in srgb, var(--lime) 70%, transparent); } }
@keyframes stageJackpot { 15%, 70% { border-color: color-mix(in srgb, var(--magenta) 75%, transparent); } }
@keyframes stageLose { 20% { transform: translateX(-3px); border-color: rgba(255,26,61,.6); } 40% { transform: translateX(3px); } 60% { transform: translateX(-2px); } 80% { transform: translateX(1px); } }

.history-strip { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 2px 0; }
.history-strip::-webkit-scrollbar { display: none; }
.hchip { flex: none; font-family: var(--f-mono); font-weight: 700; font-size: 11px; padding: 4px 9px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg-1); color: var(--text-dim); position: relative; }
.hchip.hi { color: var(--white); }
.hchip.top { color: var(--white); border-color: var(--line-strong); }
.hchip.top::after, .hchip.hi::after { content: ''; position: absolute; left: 8px; right: 8px; bottom: -1px; height: 1px; background: var(--cyan); box-shadow: 0 0 4px var(--cyan); }
.hchip.top::after { background: var(--magenta); box-shadow: 0 0 4px var(--magenta); }
.hchip.red { color: var(--red); }
.hchip.black { color: var(--white); }
.hchip.green { color: #36f59a; }

/* ─────────── плитки (мины / башня) ─────────── */
.tiles { display: grid; gap: 8px; padding: 14px; }
.cell {
  aspect-ratio: 1; border-radius: 10px; border: 1px solid var(--line);
  background: linear-gradient(160deg, #18181b, #101012);
  display: grid; place-items: center; cursor: pointer; position: relative; color: var(--muted);
  transition: transform .1s, background .2s;
}
.cell:hover:not(.open):not(.disabled) { border: var(--accent-line) solid transparent; background: linear-gradient(160deg, #1c1c20, #121214) padding-box, var(--chrome-soft) border-box; }
.cell:active:not(.open) { transform: scale(.95); }
.cell svg { width: 54%; height: 54%; stroke-width: 1.3; }
.cell.open { cursor: default; background: var(--bg-0); animation: pop .28s var(--ease); }
.cell.gem { color: #e9feff; border-color: color-mix(in srgb, var(--cyan) 55%, transparent); }
.cell.gem::after { content: ''; position: absolute; left: 25%; right: 25%; bottom: -1px; height: 1px; background: var(--cyan); box-shadow: 0 0 6px var(--cyan); }
.cell.bomb { color: var(--red); border-color: rgba(255,26,61,.7); background: rgba(255,26,61,.06); }
.cell.ghost { opacity: .32; }
.cell.disabled { cursor: default; opacity: .55; }
@keyframes pop { from { transform: scale(.82); opacity: .4; } }

/* ─────────── игральные карты (белые, как в RIVER) ─────────── */
.pcard {
  width: 62px; height: 88px; border-radius: 7px; position: relative; flex: none;
  background: #f4f4f6; border: 1px solid #d0d0d6; color: #0a0a0b;
  display: flex; flex-direction: column; justify-content: space-between; padding: 5px 6px;
  font-family: var(--f-body); font-weight: 800; font-size: 17px; line-height: 1;
  animation: deal .34s var(--ease) both; box-shadow: 0 10px 22px rgba(0,0,0,.55);
}
.pcard.red { color: var(--red); }
.pcard .suit { width: 24px; height: 24px; align-self: flex-end; }
.pcard .suit-s { width: 11px; height: 11px; }
.pcard.back { background: var(--bg-2); border: var(--accent-line) solid transparent; background: repeating-linear-gradient(45deg, #17171a 0 5px, #121214 5px 10px) padding-box, var(--chrome) border-box; }
.pcard.big { width: 96px; height: 136px; font-size: 26px; padding: 8px 9px; border-radius: 9px; }
.pcard.big .suit { width: 40px; height: 40px; }
@keyframes deal { from { opacity: 0; transform: translateY(-14px) rotate(-5deg); } }
.hand { display: flex; }
.hand .pcard + .pcard { margin-left: -16px; }

/* ─────────── топы ─────────── */
.top-list { display: flex; flex-direction: column; gap: 6px; }
.top-row { display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 10px; padding: 11px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg-1); position: relative; }
.top-row .rk { font-family: var(--f-head); font-weight: 500; font-size: 15px; text-align: center; color: var(--text-dim); }
.top-row.r1 .rk, .top-row.r2 .rk, .top-row.r3 .rk { background: var(--chrome); -webkit-background-clip: text; background-clip: text; color: transparent; font-size: 17px; }
.top-row.r1::before, .top-row.r2::before, .top-row.r3::before { content: ''; position: absolute; left: 0; top: 9px; bottom: 9px; width: 1px; }
.top-row.r1::before { background: var(--cyan); box-shadow: 0 0 6px var(--cyan); }
.top-row.r2::before { background: var(--magenta); box-shadow: 0 0 6px var(--magenta); }
.top-row.r3::before { background: var(--lime); box-shadow: 0 0 6px var(--lime); }
.top-row .nm { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-row .lv { font-family: var(--f-mono); font-size: 9.5px; color: var(--text-dim); letter-spacing: .16em; }
.top-row .val { font-family: var(--f-mono); font-weight: 700; }
.top-row.me { border: var(--accent-line) solid transparent; background: linear-gradient(var(--bg-1), var(--bg-1)) padding-box, var(--chrome) border-box; }
.my-place { position: sticky; bottom: 0; margin-top: 10px; }

/* ─────────── бонусы / профиль ─────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat { padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg-1); }
.stat .v { font-family: var(--f-mono); font-weight: 700; font-size: 17px; margin-top: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.streak { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin: 14px 0 10px; }
.streak i { height: 1px; background: var(--line); position: relative; }
.streak i.on { background: var(--white); }
.streak i.on:last-of-type::after, .streak i.now::after { content: ''; position: absolute; right: -2px; top: -1.5px; width: 4px; height: 4px; border-radius: 50%; background: #f0ffd8; box-shadow: 0 0 6px var(--lime); }
.bonus-card { display: flex; flex-direction: column; gap: 10px; }
.bonus-card .amount { font-family: var(--f-head); font-weight: 500; font-size: 24px; letter-spacing: .02em; }
.timer { font-family: var(--f-mono); color: var(--text-dim); font-size: 11.5px; letter-spacing: .06em; }
.list { display: flex; flex-direction: column; }
.list-row { display: flex; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.list-row:last-child { border-bottom: 0; }
.list-row .amt { font-family: var(--f-mono); font-weight: 700; white-space: nowrap; }
.toggle { position: relative; width: 42px; height: 24px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--bg-0); cursor: pointer; flex: none; transition: border-color .2s; }
.toggle::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--text-dim); transition: transform .25s var(--ease), background .2s; }
.toggle.on { border-color: var(--white); }
.toggle.on::after { transform: translateX(18px); background: var(--chrome); }
.code { font-family: var(--f-mono); font-size: 11px; word-break: break-all; color: var(--muted); background: var(--bg-0); border: 1px solid var(--line); border-radius: 8px; padding: 8px; user-select: text; -webkit-user-select: text; }

/* ─────────── тосты и модалки ─────────── */
.toasts { position: fixed; left: 0; right: 0; top: calc(var(--safe-top) + 64px); display: flex; flex-direction: column; align-items: center; gap: 8px; z-index: 100; pointer-events: none; padding: 0 16px; }
.toast { pointer-events: auto; max-width: 460px; width: max-content; padding: 10px 14px 10px 16px; border-radius: 10px; background: rgba(16,16,18,.97); border: 1px solid var(--line-strong); font-size: 13px; font-weight: 600; box-shadow: 0 12px 30px rgba(0,0,0,.6); animation: toastIn .25s var(--ease) both; position: relative; overflow: hidden; }
.toast::before { content: ''; position: absolute; left: 0; top: 8px; bottom: 8px; width: 1px; background: var(--white); }
.toast.err::before { background: var(--red); box-shadow: 0 0 6px var(--red); }
.toast.ok::before { background: var(--lime); box-shadow: 0 0 6px var(--lime); }
.toast.out { animation: toastOut .25s ease forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-8px); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-8px); } }

.modal-back { position: fixed; inset: 0; background: rgba(5,5,6,.78); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); z-index: 200; display: grid; place-items: center; padding: 20px; animation: fadeIn .2s ease; }
.modal { width: min(420px, 100%); max-height: 86vh; overflow-y: auto; border: var(--accent-line) solid transparent; background: linear-gradient(var(--bg-1), var(--bg-1)) padding-box, var(--chrome-soft) border-box; }
@keyframes fadeIn { from { opacity: 0; } }
.levelup { text-align: center; padding: 26px 16px; position: relative; overflow: hidden; }
.levelup .lvl { font-family: var(--f-head); font-weight: 400; font-size: 104px; line-height: 1; margin: 10px 0 6px; }
.levelup .orbit { left: 50%; top: 50%; }
.particles { position: absolute; inset: 0; pointer-events: none; overflow: hidden; border-radius: inherit; }
.particles i { position: absolute; width: 2px; height: 2px; border-radius: 50%; animation: particle 1.4s ease-out forwards; }
@keyframes particle { to { transform: translate(var(--dx), var(--dy)); opacity: 0; } }

.boot { height: 70vh; display: grid; place-content: center; gap: 22px; text-align: center; position: relative; }
.boot-logo { font-family: var(--f-head); font-weight: 400; font-size: 38px; line-height: 1.05; letter-spacing: .26em; }
.boot-line { width: 160px; height: 1px; background: var(--line); position: relative; overflow: hidden; margin: 0 auto; }
.boot-line::after { content: ''; position: absolute; inset: 0; width: 35%; background: linear-gradient(90deg, transparent, var(--cyan), transparent); animation: load 1.2s ease-in-out infinite; }
@keyframes load { from { transform: translateX(-100%); } to { transform: translateX(300%); } }

.empty { text-align: center; color: var(--text-dim); padding: 30px 10px; font-size: 13px; }
.spacer { height: 12px; }
.row-flex { display: flex; align-items: center; gap: 10px; }
.grow { flex: 1; }
.hide { display: none !important; }

/* ─────────── рулетка ─────────── */
.rboard { display: grid; grid-template-columns: 0.9fr 0.9fr 1fr 1fr 1fr; gap: 3px; padding: 10px; }
.rcell { position: relative; border-radius: 5px; display: grid; place-items: center; min-height: 30px; font-family: var(--f-mono); font-weight: 700; font-size: 13px; cursor: pointer; border: 1px solid var(--line); background: var(--bg-1); color: var(--white); transition: border-color .15s; }
.rcell:hover { border-color: var(--line-strong); }
.rcell:active { transform: scale(.95); }
.rcell.red { color: var(--red); }
.rcell.black { color: var(--white); }
.rcell.green { color: #36f59a; }
.rcell.out { font-size: 9.5px; letter-spacing: .12em; color: var(--muted); writing-mode: vertical-rl; transform: rotate(180deg); }
.rcell.out:active { transform: rotate(180deg) scale(.95); }
.rcell.win { border: var(--accent-line) solid transparent; background: linear-gradient(var(--bg-2), var(--bg-2)) padding-box, var(--chrome) border-box; z-index: 2; }
.rchip { position: absolute; top: -6px; right: -6px; min-width: 21px; height: 21px; padding: 0 5px; border-radius: 11px; background: var(--chrome); color: var(--ink); font-size: 9px; font-weight: 800; display: grid; place-items: center; box-shadow: 0 0 0 2px var(--bg-0); z-index: 3; pointer-events: none; }
.chip-select { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 2px; }
.chip-select button { flex: none; width: 44px; height: 44px; border-radius: 50%; cursor: pointer; font-family: var(--f-mono); font-weight: 700; font-size: 10.5px; color: var(--muted); border: var(--accent-line) solid transparent; background: radial-gradient(circle at 50% 35%, #202024, #0f0f12) padding-box, var(--chrome-soft) border-box; }
.chip-select button.on { background: var(--chrome) border-box; color: var(--ink); }

/* ─────────── слоты ─────────── */
.slots { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; padding: 14px; position: relative; }
.reel { height: calc(var(--sym) * 3); overflow: hidden; position: relative; border-radius: 10px; border: 1px solid var(--line); background: linear-gradient(180deg, #0a0a0b, #131316 50%, #0a0a0b); }
.reel::before, .reel::after { content: ''; position: absolute; left: 0; right: 0; height: 20%; z-index: 2; pointer-events: none; }
.reel::before { top: 0; background: linear-gradient(var(--bg-0), transparent); }
.reel::after { bottom: 0; background: linear-gradient(transparent, var(--bg-0)); }
.strip { position: absolute; left: 0; right: 0; top: 0; will-change: transform; }
.sym { height: var(--sym); display: grid; place-items: center; color: var(--sc, #d6d6dc); opacity: .82; }
.sym.hit { opacity: 1; }
.sym svg { width: 60%; height: 60%; stroke-width: 1.3; }
.sym.hit { color: var(--sc, #fff); animation: symHit .9s ease infinite alternate; }
@keyframes symHit { to { filter: drop-shadow(0 0 4px var(--sc, #fff)); } }
.slot-lines { position: absolute; inset: 14px; pointer-events: none; z-index: 3; }

/* ─────────── кено ─────────── */
.keno { display: grid; grid-template-columns: repeat(8, 1fr); gap: 5px; padding: 12px; }
.knum { aspect-ratio: 1; border-radius: 8px; border: 1px solid var(--line); background: var(--bg-1); display: grid; place-items: center; font-family: var(--f-mono); font-weight: 700; font-size: 12.5px; cursor: pointer; color: var(--muted); transition: color .15s, background .15s; position: relative; }
.knum.pick { color: var(--white); border: var(--accent-line) solid transparent; background: linear-gradient(var(--bg-2), var(--bg-2)) padding-box, var(--chrome) border-box; }
.knum.drawn { background: var(--bg-2); color: var(--white); }
.knum.hit { background: var(--white); color: var(--ink); border-color: var(--white); }
.knum.hit::after { content: ''; position: absolute; left: 20%; right: 20%; bottom: -3px; height: 1px; background: var(--lime); box-shadow: 0 0 6px var(--lime); }
.paytable { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.paytable div { flex: 1 0 auto; min-width: 46px; text-align: center; border: 1px solid var(--line); border-radius: 7px; padding: 5px 4px; font-family: var(--f-mono); font-size: 11px; color: var(--muted); }
.paytable div b { display: block; color: var(--text-dim); font-size: 9px; letter-spacing: .12em; font-weight: 500; }
.paytable div.on { color: var(--white); border-color: var(--white); }

/* ─────────── монетка: 3D, с толщиной и рифлёным ребром ─────────── */
.coin-stage { position: relative; height: 320px; display: grid; place-items: center; perspective: 1100px; }
.coin-lift { position: relative; z-index: 2; will-change: transform; }
.coin { width: 210px; height: 210px; position: relative; transform-style: preserve-3d; transition: transform 1.7s cubic-bezier(.25,.75,.25,1); }
.coin .face { position: absolute; inset: 0; border-radius: 50%; backface-visibility: hidden; -webkit-backface-visibility: hidden; background: center / cover no-repeat; }
.coin .face.front { background-image: url(../brand/coin-heads.webp); transform: translateZ(7.6px); }
.coin .face.back { background-image: url(../brand/coin-tails.webp); transform: rotateX(180deg) translateZ(7.6px); }
.coin .face::after { content: ''; position: absolute; inset: 0; border-radius: 50%; background: linear-gradient(120deg, transparent 35%, rgba(255,255,255,.28) 48%, transparent 60%); background-size: 260% 260%; background-position: 100% 100%; mix-blend-mode: soft-light; transition: background-position 1.7s ease; }
.coin.shine .face::after { background-position: 0 0; }
.coin .rim { position: absolute; inset: 1px; border-radius: 50%; background: repeating-conic-gradient(#c3c6cd 0 1.6deg, #7d818a 1.6deg 3.2deg); -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 3.5px)); mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 3.5px)); }
.coin-shadow { position: absolute; left: 50%; bottom: 34px; width: 170px; height: 22px; margin-left: -85px; border-radius: 50%; background: radial-gradient(closest-side, rgba(0,0,0,.65), transparent); z-index: 1; }
.coin-lift.toss { animation: coinToss 1.7s cubic-bezier(.3,.7,.35,1); }
.coin-stage.toss .coin-shadow { animation: coinShadow 1.7s cubic-bezier(.3,.7,.35,1); }
@keyframes coinToss { 0% { transform: translateY(0) scale(1); } 42% { transform: translateY(-120px) scale(1.1); } 82% { transform: translateY(0) scale(1); } 90% { transform: translateY(-10px); } 100% { transform: translateY(0); } }
@keyframes coinShadow { 0% { transform: scale(1); opacity: 1; } 42% { transform: scale(.5); opacity: .35; } 82%, 100% { transform: scale(1); opacity: 1; } }

/* ─────────── компьютер / широкое окно ─────────── */
@media (min-width: 900px) and (min-height: 560px) {
  :root { --gutter: 28px; }
  .tabbar { display: none; }
  .main { padding-bottom: 32px; }
  .sidenav { display: flex; flex-direction: column; gap: 4px; width: 216px; flex: none; border-right: 1px solid var(--line); padding: 24px 14px; background: var(--bg-0); }
  .sidenav .logo { font-family: var(--f-head); font-weight: 400; font-size: 17px; line-height: 1.15; letter-spacing: .26em; padding: 4px 12px 22px; }
  .sidenav .tab { flex-direction: row; justify-content: flex-start; gap: 12px; padding: 12px; border-radius: 10px; font-size: 10.5px; height: auto; border: 1px solid transparent; }
  .sidenav .tab:hover { color: var(--white); }
  .sidenav .tab.active { border: var(--accent-line) solid transparent; background: linear-gradient(var(--bg-1), var(--bg-1)) padding-box, var(--chrome-soft) border-box; }
  .sidenav .tab.active::before { top: 10px; bottom: 10px; left: -1px; right: auto; width: 1px; height: auto; background: linear-gradient(180deg, transparent, var(--cyan), transparent); }
  .sidenav .tab .dot { top: 10px; right: auto; left: 30px; }
  .games-grid { grid-template-columns: repeat(4, 1fr); }
  .game { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
  .game .controls { position: sticky; top: 0; }
  .toasts { top: 74px; }
  .hero { padding: 34px 32px 30px; }
}
@media (max-width: 380px) {
  :root { --gutter: 12px; }
  .balance-pill { font-size: 13px; padding: 6px 10px; }
  .xpbar { width: 48px; }
  .pcard { width: 54px; height: 78px; font-size: 15px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* grid-элементы не должны распирать экран */
.game > *, .controls > *, .games-grid > *, .grid-2 > *, .grid-3 > * { min-width: 0; }
.main > .view { min-width: 0; }

/* ─────────── рулетка: горизонтальная раскладка ─────────── */
.rl { display: grid; gap: 12px; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.5fr); align-items: start; }
.rl > * { min-width: 0; }
.rl .rl-side .card { padding: 12px; }
.rboard.h { grid-template-columns: 1.15fr repeat(12, 1fr) 1.15fr; grid-template-rows: repeat(3, minmax(34px, 1fr)) 30px 30px; padding: 8px 0 10px; gap: 3px; }
.rboard.h .rcell { min-height: 0; font-size: 12.5px; }
.rboard.h .rcell.side { font-size: 9.5px; letter-spacing: .12em; color: var(--muted); }
.rboard-wrap { overflow-x: auto; scrollbar-width: none; }
.rboard-wrap::-webkit-scrollbar { display: none; }
.dia { display: inline-block; width: 9px; height: 9px; transform: rotate(45deg); border: 1px solid var(--white); }
.dia.red { border-color: var(--red); background: rgba(255, 26, 61, .12); }
.rl-spin { min-height: 50px; }

.rotate-ask { position: fixed; inset: 0; z-index: 150; display: none; place-items: center; text-align: center; padding: 24px; background: rgba(10, 10, 11, .98); }
.rotate-phone { width: 60px; height: 100px; margin: 0 auto; animation: rotPhone 2.6s var(--ease) infinite; }
.rotate-phone svg { width: 100%; height: 100%; }
@keyframes rotPhone { 0%, 18% { transform: rotate(0); } 48%, 78% { transform: rotate(-90deg); } 100% { transform: rotate(0); } }

@media (orientation: portrait) and (max-width: 700px) {
  .rotate-ask:not(.dismissed) { display: grid; }
  .rl { grid-template-columns: 1fr; }
  .rboard.h { min-width: 560px; }
}
/* телефон лёжа: компактнее, без нижних вкладок в играх */
@media (orientation: landscape) and (max-height: 520px) {
  body.route-game .tabbar { display: none; }
  body.route-game .main { padding-bottom: calc(12px + var(--safe-bottom)); padding-top: 8px; }
  .topbar { padding-top: calc(var(--safe-top) + 6px); padding-bottom: 6px; }
  .avatar { width: 32px; height: 32px; }
  .game-head { margin-bottom: 8px; }
  .game-head .back { width: 32px; height: 32px; }
  .game-head .h2 { font-size: 15px; }
  .chip-select button { width: 36px; height: 36px; font-size: 9.5px; }
  .rboard.h { grid-template-rows: repeat(3, 28px) 26px 26px; padding: 6px 0; }
  .rl-spin { min-height: 40px; }
  .rl .rl-side .card { padding: 10px; }
}
.rl-actions { display: grid; grid-template-columns: 1.3fr 1fr; gap: 8px; align-items: stretch; margin-top: 4px; }
.rl-tools { grid-template-columns: repeat(2, 1fr) !important; }
.rl-tools .mini-btn { padding: 6px 4px; }
@media (orientation: landscape) and (max-height: 520px) {
  .rl .rl-side .label { display: none; }
  .rl .chip-select { margin: 0 0 2px !important; }
  .rl-tools { grid-template-columns: repeat(4, 1fr) !important; }
  .rl-actions { grid-template-columns: 1.6fr 1fr; }
}
@media (orientation: portrait) and (max-width: 700px) {
  .rl-actions { grid-template-columns: 1fr; }
  .rl-tools { grid-template-columns: repeat(4, 1fr) !important; }
}

/* ─────────── онлайн, график, лента ставок ─────────── */
.online-pill { display: inline-flex; align-items: center; gap: 7px; font-family: var(--f-mono); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; background: rgba(10,10,11,.6); }
.online-pill [data-online] { color: var(--white); font-weight: 700; }
.online-pill i { width: 5px; height: 5px; border-radius: 50%; background: #eaffd0; box-shadow: 0 0 6px var(--lime); animation: blink 1.6s infinite; }
.hero-spark { margin-top: 16px; max-width: 420px; }
.spark-wrap { position: relative; margin-top: 8px; height: 54px; }
.spark { width: 100%; height: 54px; display: block; }
.spark-total { position: absolute; right: 0; top: -22px; font-size: 13px; font-weight: 700; }
.spark-empty { height: 54px; display: grid; place-items: center start; border-top: 1px dashed var(--line); }

.ticker { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: var(--r); background: var(--bg-1); padding: 0 0 0 12px; height: 40px; margin-bottom: 14px; overflow: hidden; position: relative; }
.ticker-label { flex: none; color: var(--white); display: flex; align-items: center; gap: 6px; }
.ticker-label::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: #ffd1f1; box-shadow: 0 0 6px var(--magenta); animation: blink 1.4s infinite; }
.ticker-view { flex: 1; overflow: hidden; height: 100%; position: relative; mask-image: linear-gradient(90deg, transparent, #000 24px, #000 calc(100% - 40px), transparent); }
.ticker-track { position: absolute; left: 0; top: 0; height: 100%; display: flex; align-items: center; gap: 28px; white-space: nowrap; will-change: transform; }
.tick { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--muted); position: relative; }
.tick b { color: var(--white); font-weight: 700; }
.tick .mono { font-weight: 700; font-size: 12px; }
.tick-ico { width: 14px; height: 14px; color: #c8c8ce; display: inline-flex; }
.tick-ico svg { width: 14px; height: 14px; }
.tick::after { content: ''; position: absolute; right: -15px; top: 50%; width: 3px; height: 3px; border-radius: 50%; background: var(--line-strong); }
.tick.fresh { animation: tickIn .8s var(--ease); }
@keyframes tickIn { from { opacity: 0; transform: translateY(6px); } }

/* ─────────── онлайн-рулетка ─────────── */
.rl-left { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.rl-status { padding: 0 14px 14px; }
.rl-status [data-ph] b { font-family: var(--f-head); font-weight: 500; font-size: 13px; }
.rl-status [data-cd] { font-size: 13px; font-weight: 700; color: var(--white); }
.rl-bar { height: 1px; background: var(--line); margin-top: 8px; position: relative; }
.rl-bar i { position: absolute; left: 0; top: -0.5px; height: 2px; background: linear-gradient(90deg, transparent, var(--red)); box-shadow: 0 0 6px rgba(255,26,61,.6); transition: width .25s linear; }
.rl-players { padding: 12px 14px; }
.rl-players .list { max-height: 260px; overflow-y: auto; scrollbar-width: thin; }
.rl-prow { align-items: center; }
.rl-prow.me b { color: var(--cyan); }
.rl-pname { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.rl-pbets { display: flex; flex-wrap: wrap; gap: 4px; }
.rl-bet { font-family: var(--f-mono); font-size: 10px; color: var(--muted); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; }
.rl-bet.r { color: var(--red); border-color: rgba(255,26,61,.35); }
.rchip.placed { background: var(--bg-2); color: var(--white); box-shadow: 0 0 0 1px var(--line-strong), 0 0 0 3px var(--bg-0); }
@media (orientation: landscape) and (max-height: 520px) {
  .rl-players .list { max-height: 140px; }
  .rl-status { padding-bottom: 10px; }
}

/* ─────────── магазин фишек ─────────── */
.shop { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding-top: 8px; }
.pack {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 18px 8px 12px; border-radius: var(--r); cursor: pointer; color: var(--text);
  border: 1px solid var(--line); background: radial-gradient(120px 80px at 50% 0%, #17171a, var(--bg-1) 70%);
  transition: transform .1s, background .25s;
}
.pack:hover { border: var(--accent-line) solid transparent; background: radial-gradient(120px 80px at 50% 0%, #1a1a1e, var(--bg-1) 70%) padding-box, var(--chrome-soft) border-box; }
.pack:active { transform: scale(.97); }
.pack.tagged { border: var(--accent-line) solid transparent; background: radial-gradient(120px 80px at 50% 0%, #19191c, var(--bg-1) 70%) padding-box, var(--chrome) border-box; }
.pack::after { content: ''; position: absolute; left: 25%; right: 25%; bottom: -1px; height: 1px; background: linear-gradient(90deg, transparent, var(--pc), transparent); box-shadow: 0 0 6px var(--pc); opacity: .9; }
.pack-tag { position: absolute; top: -9px; left: 50%; transform: translateX(-50%); white-space: nowrap; font-family: var(--f-mono); font-size: 9px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink); background: var(--white); border-radius: 999px; padding: 3px 8px; }
.pack-art { width: 64px; height: 64px; }
.pack-svg { width: 100%; height: 100%; overflow: visible; }
.pack-amt { font-family: var(--f-head); font-weight: 400; font-size: 24px; letter-spacing: .03em; margin-top: 2px; }
.pack-price { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; padding: 6px 12px; border-radius: 999px; background: var(--white); color: var(--ink); font-family: var(--f-mono); font-weight: 800; font-size: 13px; }
.pack-price .star { width: 15px; height: 15px; }
.pack-price .star path { fill: #FFC83D; stroke: #D99A00; }
.pill-plus { display: grid; place-items: center; width: 20px; height: 20px; margin-left: 2px; border-radius: 50%; background: var(--white); color: var(--ink); font-family: var(--f-body); font-weight: 800; font-size: 15px; line-height: 1; }
@media (min-width: 900px) and (min-height: 560px) { .shop { max-width: 640px; } }
@media (max-width: 360px) { .pack-amt { font-size: 20px; } .pack-price { padding: 5px 9px; font-size: 12px; } }

/* ─────────── звук ─────────── */
.snd-btn { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: var(--bg-1); color: var(--muted); display: grid; place-items: center; cursor: pointer; flex: none; padding: 0; }
.snd-btn svg { width: 18px; height: 18px; }
.snd-btn:hover { color: var(--white); border-color: var(--line-strong); }
.snd-btn.off { color: var(--text-faint); }
.snd-row { align-items: center; }
.snd-row input[type=range] { width: 55%; accent-color: #f4f4f6; }

/* ─────────── джекпот и розыгрыши: диаграмма ─────────── */
.jp-tabs { margin-bottom: 12px; }
.pie-stage { padding: 16px 14px 14px; display: grid; justify-items: center; gap: 12px; min-height: 0; }
.pie-box { position: relative; width: 100%; max-width: 440px; aspect-ratio: 1 / 1; container-type: inline-size; }
.pie-box canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.pie-hub {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 34%; display: grid; justify-items: center; gap: 3px; text-align: center; pointer-events: none;
}
.pie-hub .v { font-family: var(--f-head); font-weight: 500; font-size: 15px; font-size: max(12px, 4.2cqw); letter-spacing: .02em; line-height: 1.15; white-space: nowrap; }
.pie-hub .s { font-family: var(--f-mono); font-size: 11px; font-size: max(10px, 2.9cqw); color: var(--muted); white-space: nowrap; }
.pie-hub .n { font-weight: 700; font-size: 13px; font-size: max(11px, 3.5cqw); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px; }
.pie-hub .label { font-size: 9px; }
.pie-foot { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; width: 100%; max-width: 440px; }
.pie-foot > div { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; display: grid; gap: 2px; background: rgba(10,10,11,.5); }
.pie-foot b { font-family: var(--f-mono); font-size: 14px; font-weight: 700; }

.ava {
  --ac: #6e6e74;
  width: 30px; height: 30px; border-radius: 50%; flex: none; position: relative; overflow: hidden;
  display: grid; place-items: center; background: linear-gradient(135deg, #1d1d21, #0f0f12);
  border: 1px solid var(--ac); box-shadow: 0 0 6px color-mix(in srgb, var(--ac) 40%, transparent);
}
.ava b { font-family: var(--f-mono); font-size: 10px; font-weight: 700; color: #d6d6dc; letter-spacing: .02em; }
.ava img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ava.big { width: 44px; height: 44px; width: 12cqw; height: 12cqw; }
.ava.big b { font-size: 14px; }
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }

.jp-row { position: relative; display: flex; align-items: center; gap: 10px; padding: 8px 0 8px 10px; border-top: 1px solid var(--grid); }
.jp-row:first-child { border-top: 0; }
.jp-row .jp-line { position: absolute; left: 0; top: 10px; bottom: 10px; width: 1px; background: var(--ac); box-shadow: 0 0 5px var(--ac); }
.jp-row .nm { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13.5px; color: var(--muted); }
.jp-row .am { font-family: var(--f-mono); font-size: 12.5px; font-weight: 700; text-align: right; }
.jp-row .pc { font-family: var(--f-mono); font-size: 11px; color: var(--text-dim); min-width: 50px; text-align: right; }
.jp-row.me .nm { color: var(--white); font-weight: 700; }
.jp-row.win { background: linear-gradient(90deg, color-mix(in srgb, var(--lime) 9%, transparent), transparent 70%); border-radius: 8px; }
.jp-row.win .nm { color: var(--white); }
.jp-mine:not(:empty) { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--grid); display: grid; gap: 4px; }
.prize-big { font-family: var(--f-head); font-weight: 500; font-size: clamp(28px, 8vw, 40px); letter-spacing: .02em; line-height: 1.15; margin-top: 4px; }
.fair-card .mono { font-size: 10.5px; word-break: break-all; margin-top: 6px; line-height: 1.5; }

/* ─────────── звёзды: призовой баланс и вывод ─────────── */
.star.gold path { fill: #FFC83D; stroke: #D99A00; }
.stars-card { padding: 18px; overflow: hidden; }
.stars-card::before { content: ''; position: absolute; left: 22%; right: 22%; top: -1px; height: 1px; background: linear-gradient(90deg, transparent, #FFC83D, transparent); box-shadow: 0 0 6px #FFC83D; opacity: .8; }
.stars-top { display: flex; align-items: center; gap: 14px; }
.stars-ico {
  width: 52px; height: 52px; border-radius: 50%; flex: none; position: relative; display: grid; place-items: center;
  border: var(--accent-line) solid transparent;
  background: radial-gradient(circle at 50% 30%, #1f1b10, var(--bg-1) 72%) padding-box, var(--chrome) border-box;
}
.stars-ico .star { width: 26px; height: 26px; filter: drop-shadow(0 0 6px rgba(255, 200, 61, .35)); }
.stars-ico .orbit { inset: -6px; border-color: transparent; }
.stars-ico.sm { width: 44px; height: 44px; }
.stars-ico.sm .star { width: 22px; height: 22px; }
.stars-ico.big { width: 84px; height: 84px; margin: 6px auto 0; }
.stars-ico.big .star { width: 42px; height: 42px; }
.stars-ico.big .orbit { inset: -10px; }
.stars-amt { font-family: var(--f-head); font-weight: 400; font-size: 30px; letter-spacing: .02em; line-height: 1.1; margin-top: 4px; }
.stars-btn { flex: none; min-width: 104px; }
.wd-list { margin-top: 2px; }
.wd-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--grid); font-size: 13px; color: var(--muted); }
.wd-row b { color: var(--white); }
.wd-st { font-family: var(--f-mono); font-size: 9.5px; letter-spacing: .14em; text-transform: uppercase; border: 1px solid var(--line); border-radius: 999px; padding: 4px 9px; white-space: nowrap; color: var(--text-dim); }
.wd-st.pending { color: var(--white); }
.wd-st.pending::before { content: ''; display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: #d8fbff; box-shadow: 0 0 6px var(--cyan); margin-right: 6px; vertical-align: 1px; animation: blink 1.4s infinite; }
.wd-st.paid { color: var(--lime); border-color: color-mix(in srgb, var(--lime) 35%, transparent); }
.wd-modal .quick { margin-top: 8px; display: flex; }
.wd-modal .quick .mini-btn { flex: 1; }
.wd-done { text-align: center; padding: 6px 0 2px; }
.stars-done-amt { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 8px 0 8px; }
.stars-done-amt .star { width: 26px; height: 26px; }

.bal-stack { display: grid; justify-items: end; gap: 5px; flex: none; }
.stars-pill { display: flex; align-items: center; gap: 6px; padding: 3px 10px 3px 8px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg-1); font-family: var(--f-mono); font-weight: 700; font-size: 12px; cursor: pointer; white-space: nowrap; color: var(--white); position: relative; }
.stars-pill::after { content: ''; position: absolute; left: 30%; right: 30%; bottom: -1px; height: 1px; background: linear-gradient(90deg, transparent, #FFC83D, transparent); opacity: .7; }
.stars-pill .star { width: 13px; height: 13px; }
.stars-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 16px; }
.stars-actions .btn .star { width: 16px; height: 16px; stroke-width: 1.2; }
.dep-quick { display: grid !important; grid-template-columns: repeat(3, 1fr); }
.wd-amounts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 8px; }
.wd-amt { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 54px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg-1); color: var(--white); font-family: var(--f-mono); font-weight: 800; font-size: 17px; cursor: pointer; position: relative; transition: border-color .2s; }
.wd-amt .star { width: 18px; height: 18px; }
.wd-amt.on { border: var(--accent-line) solid transparent; background: radial-gradient(120px 60px at 50% 0%, #1f1b10, var(--bg-1) 75%) padding-box, var(--chrome) border-box; }
.wd-amt.on::after { content: ''; position: absolute; left: 30%; right: 30%; bottom: -1px; height: 1px; background: linear-gradient(90deg, transparent, #FFC83D, transparent); box-shadow: 0 0 6px #FFC83D; }
.wd-amt:disabled { opacity: .3; cursor: default; }
.pie-hub .v .star { width: .78em; height: .78em; margin-left: .18em; vertical-align: -.04em; }
.pie-hub .s .star, .jp-row .star, .kv .v .star, .pie-foot .star { width: 12px; height: 12px; margin-left: 3px; vertical-align: -1px; }
.pie-hub .s { white-space: normal; max-width: 84%; line-height: 1.3; text-wrap: balance; }

/* ─────────── ракетка: рекорды иксов ─────────── */
.rec-badge { position: absolute; top: 10px; right: 12px; display: grid; justify-items: end; gap: 1px; padding: 6px 10px 6px 12px; border-radius: 10px; border: 1px solid var(--line); background: rgba(10,10,11,.72); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); pointer-events: none; max-width: 46%; }
.rec-badge::before { content: ''; position: absolute; left: -1px; top: 8px; bottom: 8px; width: 1px; background: var(--cyan); box-shadow: 0 0 6px var(--cyan); }
.rec-badge .label { font-size: 8.5px; }
.rec-badge b { font-family: var(--f-head); font-weight: 500; font-size: 17px; letter-spacing: .02em; line-height: 1.15; }
.rec-badge .nm { font-size: 11px; color: var(--muted); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rec-row { position: relative; display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--grid); }
.rec-row:first-child { border-top: 0; }
.rec-row .rk { width: 18px; flex: none; text-align: center; font-family: var(--f-mono); font-weight: 700; font-size: 12px; color: var(--text-dim); }
.rec-row .rk.top { color: var(--white); text-shadow: 0 0 8px var(--ac); }
.rec-row .nm { flex: 1; min-width: 0; display: grid; gap: 1px; }
.rec-row .nm .n { font-size: 13.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rec-row .nm .mono { font-size: 10.5px; }
.rec-row .rx { font-family: var(--f-head); font-weight: 500; font-size: 17px; letter-spacing: .02em; white-space: nowrap; }
.rec-row.me .nm .n { color: var(--white); font-weight: 700; }
.rec-row.me::before { content: ''; position: absolute; left: -16px; top: 10px; bottom: 10px; width: 1px; background: var(--cyan); box-shadow: 0 0 6px var(--cyan); }
.rec-my { display: flex; justify-content: space-between; align-items: baseline; margin-top: 6px; padding-top: 10px; border-top: 1px dashed var(--line); font-size: 12.5px; }
.rec-my b { color: var(--white); }

/* ─────────── мини-игры (кости, дартс, баскет, футбол, боулинг, бандит) ─────────── */
.tg-tabs { margin-bottom: 12px; }
.tg-scene { position: relative; display: grid; place-items: center; min-height: 250px; padding: 18px 10px 4px; }
.tg-svg { width: 100%; max-width: 420px; height: auto; display: block; overflow: visible; }
.tg-die { width: 92px; height: 92px; border-radius: 18px; display: grid; place-items: center; border: var(--accent-line) solid transparent;
  background: linear-gradient(145deg, #1c1c20, #0e0e11) padding-box, var(--chrome) border-box; box-shadow: 0 14px 30px rgba(0,0,0,.6); }
.tg-shadow { width: 90px; height: 14px; border-radius: 50%; background: radial-gradient(closest-side, rgba(0,0,0,.7), transparent); margin-top: 6px; }
.die-face { width: 62%; height: 62%; display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); place-items: center; }
.die-face i { width: 11px; height: 11px; border-radius: 50%; }
.die-face i.on { background: radial-gradient(circle at 35% 35%, #ffffff, #b4b4ba); box-shadow: 0 0 6px rgba(0,229,255,.35); }
.tg-reels { display: grid; grid-template-columns: repeat(3, 78px); gap: 10px; }
.tg-reel { height: 96px; border-radius: 12px; display: grid; place-items: center; border: var(--accent-line) solid transparent;
  background: linear-gradient(#0e0e11, #0e0e11) padding-box, var(--chrome-soft) border-box; }
.tg-reel svg { width: 46px; height: 46px; }
.tg-reel .bar { font-family: var(--f-head); font-size: 15px; letter-spacing: .08em; padding: 6px 8px; border: 1px solid var(--line-strong); border-radius: 6px; color: #d6d6dc; }
.tg-reel.spin { filter: blur(1.2px); }
.tg-result { text-align: center; padding: 6px 0 2px; display: grid; gap: 2px; }
.tg-result b { font-family: var(--f-head); font-weight: 500; font-size: 26px; letter-spacing: .03em; }
.tg-result.win b { color: var(--lime); text-shadow: 0 0 12px rgba(166,255,58,.35); }
.tg-result.lose b { color: var(--text-dim); }
.tg-hist { padding: 6px 14px 14px; justify-content: center; }
.dice-modes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 12px; }
.dice-modes .dm { border: 1px solid var(--line); background: var(--bg-1); color: var(--muted); border-radius: 10px; padding: 8px 4px; cursor: pointer; display: grid; gap: 2px; font-size: 12px; font-weight: 700; }
.dice-modes .dm small { font-family: var(--f-mono); font-size: 10px; color: var(--text-dim); font-weight: 600; }
.dice-modes .dm.num { grid-column: span 1; }
.dice-modes .dm:nth-child(n+5) { grid-column: auto; }
.dice-modes .dm.on { color: var(--white); border: var(--accent-line) solid transparent; background: linear-gradient(var(--bg-2), var(--bg-2)) padding-box, var(--chrome) border-box; }
.dice-modes .dm.on small { color: var(--cyan); }

/* ─────────── дуэли ─────────── */
.duel-arena { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; padding: 26px 14px 22px; min-height: 250px; container-type: inline-size; }
.duel-side { display: grid; justify-items: center; gap: 8px; text-align: center; transition: opacity .3s; }
.duel-side .nm { font-weight: 700; font-size: 13.5px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.duel-side.lose { opacity: .4; }
.duel-side.win .ava { box-shadow: 0 0 16px var(--lime); border-color: var(--lime); }
.duel-side .ava.big { width: 64px; height: 64px; }
.duel-die { min-height: 64px; display: grid; place-items: center; }
.duel-die:not(:empty) { width: 60px; height: 60px; border-radius: 13px; border: var(--accent-line) solid transparent; background: linear-gradient(145deg, #1c1c20, #0e0e11) padding-box, var(--chrome) border-box; }
.duel-die .die-face i { width: 8px; height: 8px; }
.duel-mid { display: grid; justify-items: center; gap: 6px; text-align: center; }
.duel-vs { font-family: var(--f-head); font-weight: 500; font-size: 28px; letter-spacing: .04em; min-height: 46px; display: grid; place-items: center; }
.duel-coin { width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; font-family: var(--f-head); font-size: 20px; color: #0a0a0b;
  background: radial-gradient(circle at 35% 30%, #ffffff, #b4b4ba 60%, #6e6e74); box-shadow: 0 0 0 1px #d6d6dc inset, 0 6px 16px rgba(0,0,0,.5); }
.duel-row, .duel-res { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--grid); }
.duel-row:first-child, .duel-res:first-child { border-top: 0; }
.duel-row .nm { flex: 1; min-width: 0; display: grid; gap: 1px; }
.duel-row .nm .n { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.duel-row .nm .mono { font-size: 10.5px; }
.duel-row .am, .duel-res .am { font-family: var(--f-mono); font-weight: 700; font-size: 12.5px; }
.duel-row.me .nm .n { color: var(--cyan); }
.duel-res { font-size: 12.5px; }
.duel-res .p { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text-dim); }
.duel-res .p:nth-child(3) { text-align: right; }
.duel-res .p.w { color: var(--white); font-weight: 700; }
.duel-res.me { background: linear-gradient(90deg, rgba(0,229,255,.06), transparent); }
.tg-canvas { padding: 10px 0 0; display: block; }
.tg-canvas-wrap { width: 100%; }
.tg-canvas canvas { display: block; width: 100%; }
