/* ЧИП-КАЗИНО rbx.one — оформление в духе блочной игровой платформы:
   тёмный фон, плоские карточки с тонкой рамкой, обложки игр 1:1, полки
   с горизонтальной прокруткой. Свой знак и свои иконки; ни логотипов,
   ни шрифтов, ни иконок чужого бренда. */

/* ===================== токены ===================== */
:root {
  color-scheme: dark;

  --bg:        #191B1D;   /* фон страницы, левая колонка */
  --surface:   #232527;   /* карточки */
  --raised:    #2D2F31;   /* приподнятые элементы, hover */
  --border:    #393B3D;   /* тонкая рамка */
  --border-2:  #4A4D50;   /* рамка при наведении */

  --text:      #FFFFFF;
  --text-2:    #BDBEBE;   /* второстепенный */
  --text-3:    #8A8C8E;   /* третичный, подписи */

  --blue:      #00A2FF;   /* ссылки, активные пункты, фокус */
  --blue-soft: rgba(0, 162, 255, .14);
  --green:     #00B06F;   /* главные действия, выигрыш */
  --green-hi:  #00C77D;
  --green-ink: #3DDC97;   /* текст-плюс на тёмном */
  --gold:      #F5C518;   /* чипы */
  --red:       #F74B4B;   /* ошибки, минус */
  --red-ink:   #FF7A7A;   /* текст-минус на тёмном */
  --violet:    #8B5CF6;
  --pink:      #FF4D9A;
  --teal:      #14D3C7;
  --ink:       #04140C;   /* тёмный текст на зелёной кнопке */

  --r-card: 8px;
  --r-btn: 6px;
  --top-h: 56px;
  --side-w: 240px;

  --font-h: 'Montserrat', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-b: 'Source Sans 3', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

/* ===================== база ===================== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-b);
  font-size: 16px;
  line-height: 1.45;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4 { font-family: var(--font-h); margin: 0; line-height: 1.2; }
p { margin: 0; }
b { font-weight: 700; }
a { color: var(--blue); }
img { display: block; max-width: 100%; }
ol, ul { margin: 0; }
svg.ic {
  width: 20px; height: 20px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
}
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; margin: -1px; padding: 0; border: 0;
}
.skip-link {
  position: absolute; left: 8px; top: -80px; z-index: 300;
  background: var(--blue); color: #001A2E; font-weight: 800;
  padding: 10px 14px; border-radius: var(--r-btn); text-decoration: none;
}
.skip-link:focus { top: 8px; }

.muted { color: var(--text-2); }
.mono {
  font-family: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  font-size: 13px; color: var(--text-2); word-break: break-all;
}
.err {
  color: var(--red-ink); background: rgba(247, 75, 75, .1);
  border: 1px solid rgba(247, 75, 75, .35); border-radius: var(--r-btn);
  padding: 9px 12px; font-size: 14px; margin-top: 10px;
}
.err.ok { color: var(--green-ink); background: rgba(0, 176, 111, .1); border-color: rgba(0, 176, 111, .35); }
.vok { color: var(--green-ink); font-weight: 800; }
.vbad { color: var(--red-ink); font-weight: 800; }
.plus { color: var(--green-ink); }
.minus { color: var(--red-ink); }

/* ===================== кнопки ===================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 0 16px; border-radius: var(--r-btn);
  border: 1px solid transparent; text-decoration: none;
  font: 800 15px/1 var(--font-h); letter-spacing: .01em;
  transition: background-color .15s ease, transform .15s ease, border-color .15s ease;
}
.btn .ic { width: 18px; height: 18px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn-primary { background: var(--green); color: var(--ink); }
.btn-primary:hover:not(:disabled) { background: var(--green-hi); }
.btn-light { background: #FFFFFF; color: #111315; }
.btn-light:hover:not(:disabled) { background: #E9EAEA; }
.btn-ghost { background: var(--border); color: var(--text); }
.btn-ghost:hover:not(:disabled) { background: var(--border-2); }
.btn-lg { min-height: 44px; padding: 0 22px; font-size: 16px; }
.btn.block { width: 100%; }
.btn.is-busy { cursor: progress; position: relative; }
.btn.is-busy::after {
  content: ""; width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent;
  animation: spin .7s linear infinite;
}

.icon-btn {
  position: relative; width: 36px; height: 36px; flex: none;
  display: grid; place-items: center;
  background: transparent; border: 0; border-radius: var(--r-btn);
  color: var(--text-2);
}
.icon-btn:hover { background: var(--raised); color: var(--text); }
.icon-btn[aria-expanded="true"] { background: var(--raised); color: var(--text); }
.dot {
  position: absolute; top: 5px; right: 5px; width: 9px; height: 9px;
  border-radius: 50%; background: var(--red); border: 2px solid var(--surface);
}

.link-btn {
  background: none; border: 0; padding: 6px 4px; border-radius: var(--r-btn);
  color: var(--blue); font: 700 14px var(--font-b); white-space: nowrap;
}
.link-btn:hover { text-decoration: underline; }

/* ===================== шапка ===================== */
.top {
  position: fixed; top: 0; left: 0; right: 0; z-index: 70;
  height: var(--top-h);
  display: flex; align-items: center; gap: 14px;
  padding: 0 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.logo {
  display: flex; align-items: center; gap: 9px; flex: none;
  color: var(--text); text-decoration: none; padding: 4px 6px 4px 0;
}
.logo-cube { width: 28px; height: 28px; flex: none; }
.logo-text {
  font: 900 21px/1 var(--font-h); letter-spacing: -.02em; color: var(--text);
}
.logo-text b { color: var(--blue); font-weight: 900; }

.top-menu { display: flex; gap: 2px; margin-left: 6px; }
.top-link {
  background: none; border: 0; padding: 0 12px; height: 36px; border-radius: var(--r-btn);
  color: var(--text-2); font: 700 14px var(--font-h);
}
.top-link:hover { color: var(--text); background: var(--raised); }

.search {
  flex: 1 1 auto; max-width: 340px; min-width: 120px; margin: 0 auto;
  display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 10px;
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--r-btn);
  color: var(--text-3);
}
.search:focus-within { border-color: var(--blue); }
.search .ic { width: 17px; height: 17px; }
.search input {
  flex: 1; min-width: 0; height: 100%; border: 0; background: transparent;
  color: var(--text); font: 600 15px var(--font-b); outline: none; padding: 0;
}
.search input::placeholder { color: var(--text-3); }
.search input::-webkit-search-cancel-button { filter: invert(.6); }

.top-title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.top-right { margin-left: auto; display: flex; align-items: center; gap: 6px; flex: none; }

.balance {
  display: flex; align-items: center; gap: 7px; height: 36px;
  padding: 0 14px 0 6px; border-radius: 999px;
  background: rgba(245, 197, 24, .1); border: 1px solid rgba(245, 197, 24, .35);
  white-space: nowrap; margin-right: 4px;
}
.balance-chip { width: 22px; height: 22px; flex: none; display: grid; }
.balance-chip svg { width: 100%; height: 100%; display: block; }
.balance-val {
  font: 800 16px/1 var(--font-h); color: var(--text);
  font-variant-numeric: tabular-nums;
}
.balance-unit { font-size: 12px; font-weight: 600; color: var(--text-2); }
.balance.bump { animation: balance-pop .4s ease; }
.balance.up { box-shadow: 0 0 0 2px rgba(0, 176, 111, .55); }
.balance.down { box-shadow: 0 0 0 2px rgba(247, 75, 75, .55); }
@keyframes balance-pop { 0% { transform: scale(1); } 40% { transform: scale(1.06); } 100% { transform: scale(1); } }

.rbx-headshot {
  width: 34px; height: 34px; flex: none; border-radius: 50%; overflow: hidden;
  display: inline-block;
  background: linear-gradient(145deg, #00A2FF 0%, #8B5CF6 100%);
  border: 2px solid rgba(255, 255, 255, .14);
}
.rbx-headshot img, .rbx-headshot svg { width: 100%; height: 100%; object-fit: cover; display: block; }

.avatar-btn {
  position: relative; width: 36px; height: 36px; flex: none; padding: 0;
  display: grid; place-items: center; overflow: hidden;
  background: var(--raised); border: 2px solid var(--border); border-radius: 50%;
  color: var(--text-2);
}
.avatar-btn:hover { border-color: var(--blue); color: var(--text); }
.avatar-btn img { width: 100%; height: 100%; object-fit: cover; }
#top-headshot { margin-left: 4px; }

/* всплывающие панели */
.pop {
  position: absolute; top: calc(100% + 8px); right: 16px; z-index: 90;
  width: 330px; max-width: calc(100vw - 16px);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card);
  padding: 14px; box-shadow: 0 18px 40px rgba(0, 0, 0, .45);
}
.pop h4 { font: 800 15px var(--font-h); margin-bottom: 10px; }
.pop-list {
  list-style: none; padding: 0; max-height: 300px; overflow: auto;
  display: flex; flex-direction: column; gap: 6px;
}
.pop-list li {
  font-size: 14px; color: var(--text-2); background: var(--bg);
  border-radius: var(--r-btn); padding: 8px 10px;
}
.pop-list li b { color: var(--text-3); font-weight: 700; margin-right: 4px; }
.pop-empty { color: var(--text-3); }
.pop-sep { height: 1px; background: var(--border); margin: 12px 0; }
.pop-hint { font-size: 12px; color: var(--text-3); margin-top: 10px; }

.switch {
  display: flex; align-items: center; gap: 12px; padding: 7px 0;
  font-size: 15px; cursor: pointer;
}
.switch input {
  -webkit-appearance: none; appearance: none; position: relative; flex: none;
  width: 40px; height: 22px; margin: 0; border-radius: 999px;
  background: var(--border-2); cursor: pointer; transition: background-color .2s ease;
}
.switch input::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px;
  border-radius: 50%; background: #fff; transition: transform .2s ease;
}
.switch input:checked { background: var(--green); }
.switch input:checked::after { transform: translateX(18px); }

/* ===================== боковая колонка ===================== */
.side {
  position: fixed; top: var(--top-h); left: 0; bottom: 0; z-index: 60;
  width: var(--side-w); padding: 14px 10px 16px;
  display: flex; flex-direction: column; gap: 10px;
  background: var(--bg); border-right: 1px solid var(--border);
  overflow-y: auto; overscroll-behavior: contain;
}
.side-me {
  display: flex; align-items: center; gap: 11px; padding: 10px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card);
}
.side-me .rbx-headshot { width: 44px; height: 44px; }
.side-me-txt { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.side-me-txt b { font: 800 15px/1.2 var(--font-h); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-me-txt span { font-size: 13px; color: var(--text-2); }
.side-me-txt span b { font: 800 13px var(--font-h); color: var(--gold); }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-sep { height: 1px; background: var(--border); margin: 8px 6px; }
.nav-item {
  position: relative; display: flex; align-items: center; gap: 12px;
  width: 100%; min-height: 40px; padding: 0 12px;
  background: transparent; border: 0; border-radius: var(--r-btn);
  color: var(--text-2); font: 600 15px/1 var(--font-b); text-align: left;
}
.nav-item .ic { width: 20px; height: 20px; }
.nav-item:hover { background: var(--surface); color: var(--text); }
.nav-item.is-on { background: var(--raised); color: var(--text); font-weight: 700; }
.nav-item.is-on .ic { color: var(--blue); }
.nav-item.is-on::before {
  content: ""; position: absolute; left: -10px; top: 8px; bottom: 8px;
  width: 4px; border-radius: 0 4px 4px 0; background: var(--blue);
}
.nav-badge {
  margin-left: auto; min-width: 22px; height: 20px; padding: 0 7px;
  display: grid; place-items: center; border-radius: 999px;
  background: var(--green); color: var(--ink);
  font: 800 11px/1 var(--font-h);
}

.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; padding-top: 10px; }
.chip-note {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 11px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-card); font-size: 13px; color: var(--text-2); line-height: 1.4;
}
.chip-note .ic { color: var(--gold); width: 18px; height: 18px; margin-top: 1px; }
.chip-note b { color: var(--text); font-weight: 700; }
.chip-note p { margin: 0; }
.side-link { font-size: 14px; font-weight: 700; padding: 4px 6px; text-decoration: none; }
.side-link:hover { text-decoration: underline; }

.side-scrim {
  position: fixed; inset: 0; z-index: 95;
  background: rgba(0, 0, 0, .55);
}

/* ===================== основная область ===================== */
.main {
  margin-left: var(--side-w);
  padding: calc(var(--top-h) + 22px) 28px 40px;
  min-height: 100vh;
  outline: none;
  min-width: 0;
}
.view { max-width: 1240px; margin: 0 auto; }

.banner {
  margin: 0 0 18px; padding: 12px 16px;
  border-radius: var(--r-card);
  background: var(--blue-soft); border: 1px solid rgba(0, 162, 255, .35);
  color: var(--text); font-size: 15px;
}
.banner.warn { background: rgba(245, 197, 24, .12); border-color: rgba(245, 197, 24, .4); }

.row-head {
  display: flex; align-items: baseline; justify-content: space-between;
  flex-wrap: wrap; gap: 6px 14px; margin: 30px 0 12px;
}
.row-head:first-of-type { margin-top: 0; }
.row-head h2 { font: 800 21px/1.2 var(--font-h); }
.row-head .muted { font-size: 14px; }

/* ===================== герой ===================== */
.hero {
  position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  min-height: 300px; padding: 36px 40px;
  border-radius: 12px; border: 1px solid rgba(255, 255, 255, .08);
  background: linear-gradient(118deg, #0E6FD8 0%, #3B4BD8 46%, #7B3FE4 100%);
  margin-bottom: 8px;
}
.hero-glow {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(circle at 85% 20%, rgba(255, 255, 255, .16), transparent 42%),
    radial-gradient(circle at 10% 110%, rgba(0, 0, 0, .22), transparent 50%);
}
.hero-body { position: relative; min-width: 0; max-width: 620px; flex: 1 1 auto; }
.hero-hello { font: 600 17px var(--font-b); color: rgba(255, 255, 255, .9); }
.hero-hello b { font: 900 17px var(--font-h); color: #fff; }
.tag {
  display: inline-block; margin-top: 12px; padding: 4px 10px;
  border-radius: 6px; background: rgba(0, 0, 0, .25);
  font: 700 12px/1.2 var(--font-h); color: #fff; letter-spacing: .02em;
}
.hero-title {
  color: #fff; margin: 12px 0 8px;
  font: 900 clamp(28px, 4vw, 44px)/1.05 var(--font-h);
  letter-spacing: -.015em;
}
.hero-sub { color: rgba(255, 255, 255, .9); font-size: 18px; max-width: 46ch; }
.hero-stats { display: flex; flex-wrap: wrap; gap: 10px; margin: 20px 0 22px; }
.hstat {
  display: flex; flex-direction: column; min-width: 110px;
  padding: 9px 13px; border-radius: var(--r-btn); background: rgba(0, 0, 0, .24);
}
.hstat b { font: 800 21px/1.15 var(--font-h); color: #fff; font-variant-numeric: tabular-nums; }
.hstat span { font-size: 13px; color: rgba(255, 255, 255, .85); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }

.hero-art { position: relative; flex: none; display: grid; place-items: center; }
.hero-mascot {
  position: relative; width: 300px; height: 300px; max-width: 100%;
  border-radius: 50%;
}
/* пока персонаж не вставлен — декоративная заглушка, а не дыра */
.hero-mascot:empty::before {
  content: ""; position: absolute; inset: 14px; border-radius: 50%;
  background: radial-gradient(circle at 50% 45%, rgba(255, 255, 255, .22), rgba(255, 255, 255, .04) 62%, transparent 70%);
}
.hero-mascot:empty::after {
  content: ""; position: absolute; inset: 52px; border-radius: 50%;
  border: 16px dashed rgba(245, 197, 24, .55);
}

/* ===================== полки и плитки игр ===================== */
.shelf {
  display: flex; gap: 14px; overflow-x: auto;
  scroll-snap-type: x mandatory; scroll-padding: 2px;
  padding: 4px 2px 14px; margin: 0 -2px;
  scrollbar-width: thin; scrollbar-color: var(--border-2) transparent;
}
.shelf > * { scroll-snap-align: start; flex: 0 0 auto; }

.game-grid {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(min(190px, 100%), 1fr));
}
.game-grid > .game { width: 100%; }

.game {
  position: relative; display: flex; flex-direction: column;
  width: 184px; padding: 0; overflow: hidden;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card);
  color: var(--text); text-align: left;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.game:hover { transform: translateY(-2px); box-shadow: 0 12px 26px rgba(0, 0, 0, .4); border-color: var(--border-2); }
.game:focus-visible { outline-offset: 3px; }

.game-ic {
  position: relative; width: 100%; aspect-ratio: 1 / 1;
  display: grid; place-items: center; overflow: hidden;
  background: linear-gradient(140deg, #0E6FD8, #3B4BD8);
}
.game-ic::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(rgba(255, 255, 255, .14) 1.2px, transparent 1.6px);
  background-size: 16px 16px;
}
.game-ic::after {
  content: "▶ Играть"; position: absolute; left: 50%; bottom: 14px; transform: translate(-50%, 8px);
  padding: 9px 16px; border-radius: var(--r-btn); white-space: nowrap;
  background: var(--green); color: var(--ink);
  font: 800 14px/1 var(--font-h);
  opacity: 0; transition: opacity .18s ease, transform .18s ease;
  pointer-events: none;
}
.game:hover .game-ic::after,
.game:focus-visible .game-ic::after { opacity: 1; transform: translate(-50%, 0); }
.game-ic .ic { width: 42%; height: 42%; color: rgba(255, 255, 255, .95); stroke-width: 1.6; position: relative; }
.game-ic.dice  { background: linear-gradient(140deg, #8B5CF6, #4B2BB0); }
.game-ic.wheel { background: linear-gradient(140deg, #FF4D9A, #A3205E); }
.game-ic.coin  { background: linear-gradient(140deg, #F5C518, #B7850A); }
.game-ic.coin .ic { color: #241A00; }

.game > h3 {
  margin: 11px 11px 3px; min-height: 36px;
  font: 800 15px/1.2 var(--font-h);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.game > p {
  margin: 0 11px; font-size: 13px; color: var(--text-3); line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden;
}
.game-foot {
  display: flex; flex-wrap: wrap; gap: 4px 10px;
  margin: 8px 11px 12px; font-size: 13px; font-weight: 600; color: var(--text-2);
}

/* полка: плитки на фиксированной ширине, игровые - в сетке на странице игр */
.shelf-games .game { width: 184px; }
#view-games .game-grid .game { width: 100%; }

/* ===================== пиллы (бейджи) ===================== */
.pill {
  display: inline-flex; align-items: center; padding: 3px 8px;
  border-radius: 4px; background: var(--raised); color: var(--text-2);
  font: 700 12px/1.2 var(--font-h); white-space: nowrap;
}
.pill.good { background: rgba(0, 176, 111, .16); color: var(--green-ink); }
.pill.warn { background: rgba(245, 197, 24, .14); color: #FFD35C; }
.game-foot .pill {
  padding: 0; background: none; border-radius: 0;
  font: 600 13px/1.2 var(--font-b); color: var(--text-2);
}
.game-foot .pill.good { color: var(--green-ink); }
.game-foot .pill.warn { color: #FFD35C; }

/* ===================== пулы ===================== */
.pool {
  position: relative; display: flex; flex-direction: column; gap: 11px;
  width: min(308px, 82vw); padding: 15px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.pool:hover { transform: translateY(-2px); box-shadow: 0 12px 26px rgba(0, 0, 0, .38); border-color: var(--border-2); }
.pool-top { display: flex; align-items: center; gap: 10px; min-width: 0; }
.pool-ic {
  width: 38px; height: 38px; flex: none; display: grid; place-items: center;
  border-radius: var(--r-btn); background: linear-gradient(140deg, #0E6FD8, #3B4BD8);
}
.pool-ic .ic { width: 20px; height: 20px; color: #fff; }
.pool-ic.dice  { background: linear-gradient(140deg, #8B5CF6, #4B2BB0); }
.pool-ic.wheel { background: linear-gradient(140deg, #FF4D9A, #A3205E); }
.pool-ic.coin  { background: linear-gradient(140deg, #F5C518, #B7850A); }
.pool-ic.coin .ic { color: #241A00; }
.pool-name {
  flex: 1; min-width: 0; font: 800 15px/1.2 var(--font-h);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pool-state {
  flex: none; padding: 4px 7px; border-radius: 4px;
  font: 800 11px/1 var(--font-h); letter-spacing: .04em; text-transform: uppercase;
  background: var(--raised); color: var(--text-2);
}
.st-OPEN      { background: rgba(0, 176, 111, .18); color: var(--green-ink); }
.st-LOCKED    { background: rgba(245, 197, 24, .16); color: #FFD35C; }
.st-SETTLING  { background: var(--blue-soft); color: var(--blue); }
.st-SETTLED   { background: var(--raised); color: var(--text-2); }
.st-CANCELLED { background: rgba(247, 75, 75, .16); color: var(--red-ink); }

.pool-pot { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.pool-pot b {
  font: 900 28px/1 var(--font-h); color: var(--gold);
  font-variant-numeric: tabular-nums;
}
.pool-pot span { font-size: 14px; color: var(--text-2); }

.pool-split { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; color: var(--text-2); }
.pool-split span i { font-style: normal; color: var(--text); font-weight: 700; font-variant-numeric: tabular-nums; }

.timer { height: 6px; border-radius: 3px; background: var(--raised); overflow: hidden; }
.timer i {
  display: block; height: 100%; width: 0;
  background: linear-gradient(90deg, var(--blue), var(--green));
  transition: width .9s linear;
}
.timer.hot i { background: var(--red); }
.timer-txt { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--text-3); }
.tl { color: var(--text-2); font-weight: 700; font-variant-numeric: tabular-nums; }

.opt-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 8px; }
.opt {
  --c: var(--blue);
  display: flex; flex-direction: column; align-items: flex-start; gap: 3px;
  min-height: 56px; padding: 10px 11px 9px;
  background: var(--raised); border: 1px solid var(--border); border-top: 3px solid var(--c);
  border-radius: var(--r-btn); color: var(--text); text-align: left;
  transition: border-color .15s ease, background-color .15s ease;
}
.opt:hover:not(:disabled) { background: #34373A; border-color: var(--c); }
.opt:disabled { opacity: .5; cursor: not-allowed; }
.opt > span:first-child { font: 800 14px/1.2 var(--font-h); }
.opt small { font-size: 12px; color: var(--text-2); }
.opt .mine-amt { font-size: 12px; font-weight: 700; color: var(--green-ink); }
.opt.mine { border-color: var(--green); background: rgba(0, 176, 111, .12); }
.o-blue   { --c: var(--blue); }
.o-cyan   { --c: var(--teal); }
.o-violet { --c: var(--violet); }
.o-pink   { --c: var(--pink); }
.o-gold   { --c: var(--gold); }
.o-slate  { --c: #6C7396; }
.o-green, .o-emerald { --c: var(--green); }
.o-red    { --c: var(--red); }

.bets {
  display: flex; flex-direction: column; gap: 2px;
  max-height: 200px; overflow: auto;
  padding-top: 9px; border-top: 1px solid var(--border);
}
.bet {
  display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; align-items: center;
  padding: 5px 2px; font-size: 14px;
}
.bet .who { color: var(--text-2); }
.bet .pick { color: var(--text); }
.bet .amt { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }

.pool-list {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(min(308px, 100%), 1fr));
}
.pool-list .pool { width: 100%; }
.pool-strip { display: flex; }

/* ===================== пустые, скелеты, тосты ===================== */
.empty {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px;
  width: 100%; padding: 30px 22px;
  background: var(--surface); border: 1px dashed var(--border-2); border-radius: var(--r-card);
  color: var(--text-2);
}
.empty > .ic { width: 36px; height: 36px; color: var(--text-3); margin-bottom: 6px; }
.empty b { font: 800 16px/1.3 var(--font-h); color: var(--text); }
.empty p { font-size: 15px; max-width: 46ch; }
.shelf > .empty { min-width: 320px; }

.skel {
  background: linear-gradient(90deg, var(--surface) 20%, var(--raised) 38%, var(--surface) 58%);
  background-size: 300% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
  border-radius: var(--r-card);
}
.skel-pool    { flex: 0 0 auto; width: 308px; height: 214px; }
.skel-game    { flex: 0 0 auto; width: 184px; height: 250px; }
.skel-row     { width: 100%; height: 68px; margin-bottom: 8px; border-radius: var(--r-card); }
.skel-pool-lg { width: 100%; height: 214px; margin-bottom: 14px; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }

.toasts {
  position: fixed; right: 16px; z-index: 120;
  bottom: calc(16px + var(--vv-bottom, 0px));
  display: flex; flex-direction: column; align-items: flex-end; gap: 8px;
  width: min(380px, calc(100vw - 32px)); pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 10px; max-width: 100%;
  padding: 12px 14px; pointer-events: auto;
  background: var(--raised); color: var(--text);
  border: 1px solid var(--border); border-left: 4px solid var(--blue);
  border-radius: var(--r-card); box-shadow: 0 12px 30px rgba(0, 0, 0, .45);
  font: 600 15px/1.35 var(--font-b);
  animation: toast-in .25s ease;
  transition: opacity .25s ease, transform .25s ease;
}
.toast > .ic { width: 20px; height: 20px; color: var(--blue); }
.toast.win  { border-left-color: var(--green); }
.toast.win > .ic { color: var(--green-ink); }
.toast.bad  { border-left-color: var(--red); }
.toast.bad > .ic { color: var(--red-ink); }
.toast.lose { border-left-color: var(--text-3); }
.toast.lose > .ic { color: var(--text-2); }
.toast.out  { opacity: 0; transform: translateY(6px); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ===================== баннер героя и заглушки ===================== */
.game-stage {
  position: relative; display: grid; place-items: center;
  min-height: 380px; margin-bottom: 16px; padding: 24px;
  border-radius: 12px; border: 1px dashed var(--border-2);
  background:
    radial-gradient(circle at 50% 0%, rgba(0, 162, 255, .12), transparent 60%),
    var(--surface);
}
.game-stage:empty::before {
  content: "Игра скоро появится"; font: 800 18px/1.2 var(--font-h); color: var(--text-2);
}

/* ===================== панели (игры, фэйр, админка) ===================== */
.panel {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card);
  padding: 20px; margin-bottom: 16px;
}
.panel-head { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; min-width: 0; }
.panel-head > div { min-width: 0; }
.panel-head h3 { font: 800 18px/1.25 var(--font-h); }
.panel-head p { font-size: 14px; color: var(--text-2); margin-top: 3px; }
.panel-head > .btn { margin-left: auto; }
.panel-ic {
  width: 44px; height: 44px; flex: none; border-radius: var(--r-card);
  display: grid; place-items: center; color: #fff;
  background: var(--raised);
}
.panel-ic .ic { width: 22px; height: 22px; }
.ic-dice   { background: linear-gradient(140deg, #8B5CF6, #4B2BB0); }
.ic-wheel  { background: linear-gradient(140deg, #FF4D9A, #A3205E); }
.ic-shield { background: linear-gradient(140deg, #00A2FF, #0064B8); }
.ic-flag   { background: linear-gradient(140deg, #F5C518, #B7850A); color: #241A00; }

.controls { display: flex; flex-direction: column; gap: 14px; }

/* поля ввода */
.field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--text-2); min-width: 0; }
.field > span { font-weight: 600; }
.field.grow { flex: 1 1 180px; }
input, select, textarea {
  width: 100%; min-height: 42px; padding: 9px 12px;
  background: var(--bg); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--r-btn);
  font: 600 16px var(--font-b); outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
textarea { min-height: 96px; resize: vertical; }
input::placeholder, textarea::placeholder { color: var(--text-3); font-weight: 400; }
input:focus, select:focus, textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(0, 162, 255, .25); }
input[type="range"] { accent-color: var(--blue); padding: 0; min-height: 28px; background: none; border: 0; box-shadow: none; }
select { appearance: auto; }
input[type="checkbox"] { width: auto; }

.quick { display: flex; flex-wrap: wrap; gap: 6px; }
.quick button {
  min-width: 46px; height: 34px; padding: 0 12px; border-radius: 999px;
  background: var(--raised); color: var(--text); border: 1px solid var(--border);
  font: 700 14px var(--font-b);
}
.quick button:hover { border-color: var(--blue); color: var(--blue); }
.stake-row { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.stake-row .quick { padding-bottom: 2px; }

/* ===================== кости ===================== */
.dice-stage {
  display: flex; align-items: center; gap: 26px; flex-wrap: wrap;
  padding: 22px; margin-bottom: 18px;
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--r-card);
}
.dice-roll {
  width: 128px; height: 128px; flex: none;
  display: grid; place-items: center;
  background: linear-gradient(150deg, #3A3D40, #222426);
  border: 2px solid var(--border-2); border-radius: 18px;
  box-shadow: 0 8px 0 #111214;
  font: 900 46px/1 var(--font-h); color: var(--text); font-variant-numeric: tabular-nums;
  transition: border-color .25s ease, box-shadow .25s ease, color .25s ease;
}
.dice-roll.win { border-color: var(--green); color: var(--green-ink); box-shadow: 0 8px 0 #0A5A39, 0 0 0 5px rgba(0, 176, 111, .18); }
.dice-roll.lose { color: var(--red-ink); border-color: #5A3A3A; }
.dice-roll.rolling { animation: rattle .35s linear infinite; }
@keyframes rattle { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-4deg); } 75% { transform: rotate(4deg); } }
.dice-meter { flex: 1 1 260px; min-width: 0; }
.meter-bar { position: relative; height: 16px; border-radius: 4px; background: var(--raised); overflow: hidden; }
.meter-win { position: absolute; top: 0; bottom: 0; right: 0; left: 50%; background: linear-gradient(90deg, rgba(0, 176, 111, .55), var(--green)); }
.meter-mark { position: absolute; top: -4px; bottom: -4px; width: 3px; margin-left: -1.5px; background: #fff; border-radius: 2px; }
.meter-labels { display: flex; justify-content: space-between; margin-top: 6px; font-size: 13px; color: var(--text-3); font-variant-numeric: tabular-nums; }

.odds { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.odds > div {
  padding: 10px 8px; text-align: center;
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--r-card);
}
.odds b { display: block; font: 900 20px/1.2 var(--font-h); color: var(--text); font-variant-numeric: tabular-nums; }
.odds span { font-size: 13px; color: var(--text-2); }

.mini-hist { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; }
.mh {
  min-width: 46px; padding: 6px 8px; text-align: center;
  border-radius: var(--r-btn); background: var(--raised);
  font: 800 13px/1.2 var(--font-h); font-variant-numeric: tabular-nums;
  color: var(--text-2);
}
.mh.win { background: rgba(0, 176, 111, .2); color: var(--green-ink); }
.mh.lose { background: rgba(247, 75, 75, .14); color: var(--red-ink); }

/* ===================== колесо ===================== */
.wheel-stage {
  position: relative; display: grid; justify-items: center; gap: 12px;
  padding: 22px 0 10px;
}
.wheel-wrap { width: min(300px, 78vw); aspect-ratio: 1 / 1; position: relative; }
/* только сам круг колеса: класс .wheel также выставляется у иконок игр (game-ic, pool-ic) */
#wheel {
  width: 100%; height: 100%; border-radius: 50%;
  border: 6px solid var(--raised);
  box-shadow: 0 0 0 1px var(--border), 0 14px 34px rgba(0, 0, 0, .45);
  transition: transform 3.1s cubic-bezier(.12, .75, .1, 1);
}
.wheel-pointer {
  position: absolute; top: 6px; left: 50%; z-index: 2; transform: translateX(-50%);
  width: 0; height: 0;
  border-left: 13px solid transparent; border-right: 13px solid transparent;
  border-top: 22px solid #fff;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .5));
}
.wheel-out {
  min-height: 42px; font: 900 28px/1.2 var(--font-h); text-align: center;
  color: var(--text-2); font-variant-numeric: tabular-nums;
}
.wheel-out.win { color: var(--green-ink); }
.wheel-out.lose { color: var(--red-ink); }
.seg-legend { display: flex; flex-wrap: wrap; gap: 8px; }
.seg {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 10px; font-size: 14px;
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--r-btn);
}
.seg i { width: 12px; height: 12px; border-radius: 3px; flex: none; }
.seg b { font-weight: 700; }
.seg span { color: var(--text-2); }

/* ===================== история, лидеры ===================== */
.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.tab {
  height: 36px; padding: 0 15px; border-radius: 999px;
  background: var(--surface); color: var(--text-2); border: 1px solid var(--border);
  font: 700 14px/1 var(--font-b);
}
.tab:hover { color: var(--text); border-color: var(--border-2); }
.tab.is-on { background: var(--blue); border-color: var(--blue); color: #001A2E; font-weight: 800; }

.rowc {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; margin-bottom: 8px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card);
  transition: border-color .15s ease, transform .15s ease;
}
.rowc.clickable { cursor: pointer; }
.rowc.clickable:hover { border-color: var(--border-2); transform: translateY(-1px); }
.rc-main { flex: 1; min-width: 0; }
.rc-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font: 800 15px/1.3 var(--font-h); }
.rc-sub { color: var(--text-3); font-size: 13px; margin-top: 2px; font-variant-numeric: tabular-nums; }
.rc-val {
  font: 800 16px/1.2 var(--font-h); color: var(--text-2);
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.rc-val.plus { color: var(--green-ink); }
.rc-val.minus { color: var(--red-ink); }

.board { display: flex; flex-direction: column; gap: 8px; }
.brow {
  display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: 12px;
  padding: 12px 14px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card);
}
.rank { font: 900 18px/1 var(--font-h); color: var(--text-3); text-align: center; }
.brow:nth-child(1) .rank { color: var(--gold); }
.brow:nth-child(2) .rank { color: #D4D7DC; }
.brow:nth-child(3) .rank { color: #D98B4A; }
.brow > div:nth-child(2) { min-width: 0; }
.bname { font: 800 15px/1.3 var(--font-h); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bsub { font-size: 13px; color: var(--text-3); }
.bval { font: 800 17px/1.2 var(--font-h); color: var(--green-ink); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ===================== профиль ===================== */
.profile-card {
  position: relative; overflow: hidden; margin-bottom: 22px;
  padding: 22px 24px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 12px;
}
.profile-card::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 96px;
  background: linear-gradient(118deg, #0E6FD8, #3B4BD8 50%, #7B3FE4);
}
.pc-top { position: relative; display: flex; align-items: flex-end; gap: 18px; flex-wrap: wrap; margin-top: 34px; }
.pc-avatar {
  width: 104px; height: 104px; flex: none; border-radius: 50%; overflow: hidden;
  display: grid; place-items: center;
  background: linear-gradient(145deg, #2D2F31, #1B1D1F);
  border: 4px solid var(--surface); color: var(--text-2);
}
.pc-avatar svg.ic { width: 56px; height: 56px; }
.pc-avatar img { width: 100%; height: 100%; object-fit: cover; }
.pc-id { flex: 1 1 240px; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.pc-id h2 { font: 900 24px/1.15 var(--font-h); overflow-wrap: anywhere; }
.pc-level { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.lvl-badge {
  width: 30px; height: 30px; flex: none; display: grid; place-items: center;
  border-radius: 50%; background: var(--blue); color: #001A2E;
  font: 900 14px/1 var(--font-h);
}
.lvl-bar { width: 170px; max-width: 100%; height: 8px; border-radius: 4px; background: var(--raised); overflow: hidden; }
.lvl-bar > div {
  height: 100%; border-radius: 4px; transition: width .4s ease;
  background: linear-gradient(90deg, var(--blue), var(--green));
}
.role-chip {
  align-self: flex-start; padding: 4px 10px; border-radius: var(--r-btn);
  background: var(--raised); border: 1px solid var(--border);
  font: 700 12px/1.2 var(--font-h); color: var(--text-2);
}
.role-chip.admin { color: var(--gold); border-color: rgba(245, 197, 24, .4); }
.pc-wallet { display: flex; gap: 10px; flex-wrap: wrap; }
.pcw {
  min-width: 150px; padding: 10px 14px;
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--r-card);
}
.pcw b { display: block; font: 900 21px/1.2 var(--font-h); color: var(--gold); font-variant-numeric: tabular-nums; }
.pcw span { font-size: 13px; color: var(--text-2); }
.pc-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; margin-top: 20px; }
.pstat {
  padding: 12px 14px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--r-card);
}
.pstat b { display: block; font: 800 18px/1.25 var(--font-h); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.pstat span { font-size: 13px; color: var(--text-2); }

/* ===================== честность ===================== */
.steps {
  display: flex; flex-direction: column; gap: 8px;
  padding-left: 24px; margin-bottom: 12px; color: var(--text-2); font-size: 15px;
}
.steps li::marker { color: var(--blue); font-weight: 800; }
.note {
  padding: 12px 14px; font-size: 15px; color: var(--text-2);
  background: var(--bg); border-radius: var(--r-card); border-left: 3px solid var(--blue);
}
.period-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 12px; }
.period {
  display: flex; flex-direction: column; gap: 6px; padding: 14px;
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--r-card);
  font-size: 14px; color: var(--text-2); min-width: 0;
}
.ph { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.ph b { font: 800 16px/1.2 var(--font-h); color: var(--text); }
.verify-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; align-items: end;
}
.verify-grid .btn { width: 100%; }
.verify-out {
  display: flex; flex-direction: column; gap: 8px; margin-top: 14px; padding: 14px;
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--r-card);
  font-size: 15px; word-break: break-word;
}
.verify-out b { color: var(--text-2); font-weight: 700; }
.verify-out .mono { color: var(--text); }
.rules { display: flex; flex-direction: column; gap: 10px; font-size: 15px; color: var(--text-2); }
.rules b { color: var(--text); }

/* ===================== админка ===================== */
.admin-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin-bottom: 16px; }
.acard {
  display: flex; flex-direction: column; gap: 4px; padding: 14px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card);
}
.acard b { font: 900 21px/1.2 var(--font-h); color: var(--text); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.acard span { font-size: 13px; color: var(--text-2); }
.acard.ok b { color: var(--green-ink); }
.acard.bad b { color: var(--red-ink); }
.cfg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(270px, 100%), 1fr)); gap: 12px; }
.cfg {
  display: flex; flex-direction: column; gap: 8px; padding: 13px;
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--r-card);
}
.cfg > label { font: 700 14px/1.3 var(--font-b); color: var(--text); }
.cfg-row { display: flex; gap: 8px; }
.cfg-row > input, .cfg-row > select { flex: 1; min-width: 0; }
.cfg-row > button, .act button, .adm-table button, .issue-grid > .btn { min-height: 36px; }
.cfg-row > button, .act button, .adm-table button {
  padding: 0 12px; border-radius: var(--r-btn); border: 1px solid var(--border-2);
  background: var(--raised); color: var(--text); font: 700 13px/1 var(--font-b); white-space: nowrap;
}
.cfg-row > button:hover, .act button:hover, .adm-table button:hover { border-color: var(--blue); color: var(--blue); }
.act button.dgr { color: var(--red-ink); border-color: rgba(247, 75, 75, .4); }
.act button.dgr:hover { background: rgba(247, 75, 75, .12); border-color: var(--red); color: var(--red-ink); }
.lim { font-size: 13px; color: var(--text-3); }
.issue-grid { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 12px; margin-bottom: 12px; }
.issue-grid > .field { flex: 1 1 170px; }
.issue-grid > .btn { flex: none; }
.recon-out {
  display: flex; flex-direction: column; gap: 8px; padding: 14px;
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--r-card);
  font-size: 15px; color: var(--text-2);
}
.recon-out > div:first-child { font-weight: 700; }
.finding {
  padding: 8px 11px; font-size: 14px; color: var(--text-2);
  background: var(--surface); border-left: 3px solid var(--blue); border-radius: var(--r-btn);
}
.finding.warn { border-left-color: var(--gold); }
.finding.critical, .finding.error, .finding.bad { border-left-color: var(--red); color: var(--text); }

.adm-table {
  overflow-x: auto; border: 1px solid var(--border); border-radius: var(--r-card);
  scrollbar-width: thin; scrollbar-color: var(--border-2) transparent;
}
.adm-table table { width: 100%; min-width: 620px; border-collapse: collapse; font-size: 14px; }
.adm-table th {
  padding: 10px 12px; text-align: left; white-space: nowrap;
  font: 700 12px/1.2 var(--font-h); letter-spacing: .03em; color: var(--text-3);
  background: var(--bg); border-bottom: 1px solid var(--border);
}
.adm-table td {
  padding: 10px 12px; vertical-align: top; color: var(--text-2);
  border-bottom: 1px solid var(--border);
}
.adm-table tbody tr:last-child td { border-bottom: 0; }
.adm-table td .mono { color: var(--text); }
.adm-table .empty { border: 0; border-radius: 0; }
.act { display: flex; gap: 6px; flex-wrap: wrap; }
.adm-table td > div:not(.act) { line-height: 1.5; }

/* ===================== подвал ===================== */
.foot {
  margin-top: 36px; padding: 18px 0 6px;
  border-top: 1px solid var(--border);
  font-size: 13px; line-height: 1.55; color: var(--text-3);
}
.foot p { max-width: 96ch; }

/* ===================== модальные окна ===================== */
.modal {
  position: fixed; inset: 0; z-index: 200;
  display: grid; place-items: center; padding: 16px;
}
.modal-scrim { position: absolute; inset: 0; background: rgba(0, 0, 0, .62); }
.modal-box {
  position: relative; width: min(440px, 100%); max-height: calc(100vh - 32px); overflow: auto;
  padding: 22px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; box-shadow: 0 26px 60px rgba(0, 0, 0, .55);
}
.modal-box > h3 { font: 900 21px/1.25 var(--font-h); margin-bottom: 12px; }
.modal-box > p { font-size: 15px; line-height: 1.5; }
.modal-sum {
  display: flex; flex-direction: column; gap: 7px;
  padding: 12px 14px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--r-card);
}
.ms { display: flex; justify-content: space-between; align-items: baseline; gap: 14px; font-size: 14px; color: var(--text-2); }
.ms b { color: var(--text); font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.ms.hi b { font: 900 19px/1.2 var(--font-h); color: var(--gold); }
.modal-foot { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 10px; margin-top: 18px; }

/* ===================== нижняя навигация (телефон) ===================== */
.only-mobile { display: none; }
.tabbar { display: none; }
.tb {
  flex: 1; min-width: 0; min-height: 54px; padding: 6px 2px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  background: none; border: 0; border-radius: var(--r-btn);
  color: var(--text-3); font: 700 11px/1.1 var(--font-b);
}
.tb .ic { width: 22px; height: 22px; }
.tb.is-on { color: var(--text); }
.tb.is-on .ic { color: var(--blue); }
.tb:hover { color: var(--text); }

/* ===================== всплывающий «burst» при выигрыше ===================== */
.burst { position: fixed; inset: 0; z-index: 150; pointer-events: none; overflow: hidden; }
.burst i {
  position: absolute; width: 8px; height: 12px; border-radius: 2px;
  animation: burst-fly 1.4s cubic-bezier(.2, .7, .3, 1) forwards;
}
@keyframes burst-fly {
  from { transform: translate(0, 0) rotate(0); opacity: 1; }
  to   { transform: translate(var(--dx, 0), var(--dy, 0)) rotate(var(--rot, 0deg)); opacity: 0; }
}

/* ===================== адаптив ===================== */
@media (max-width: 1180px) {
  .top-menu { display: none; }
}

/* средние ширины: сайдбар остаётся, герой встаёт в колонку, чтобы текст не сжимался */
@media (max-width: 1000px) {
  .hero { flex-direction: column; align-items: stretch; gap: 10px; }
  .hero-body { max-width: none; }
  .hero-art { order: -1; justify-content: end; }
  .hero-mascot { width: 170px; height: 170px; }
  .hero-mascot:empty::after { inset: 34px; border-width: 11px; }
}

@media (max-width: 860px) {
  :root { --side-w: 0px; }

  .only-mobile { display: flex; }
  .icon-btn.only-mobile { display: grid; }
  .tabbar {
    position: fixed; left: 0; right: 0; bottom: var(--vv-bottom, 0px); z-index: 80;
    display: flex; gap: 2px; padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    background: var(--surface); border-top: 1px solid var(--border);
  }

  /* боковая панель уезжает за левый край и выезжает поверх */
  .side {
    top: 0; z-index: 100; width: min(300px, 84vw); padding-top: calc(var(--top-h) + 12px);
    transform: translateX(-104%); transition: transform .25s ease, box-shadow .25s ease;
    box-shadow: none; visibility: hidden;
  }
  .side.open { transform: none; visibility: visible; box-shadow: 0 0 40px rgba(0, 0, 0, .6); }
  .side .nav-item { min-height: 44px; }
  .side-scrim { z-index: 95; }

  .top { gap: 8px; padding: 0 8px; }
  .search { display: none; }
  .top-right { gap: 4px; }
  .balance { margin-right: 0; padding: 0 10px 0 5px; }
  .balance-unit { display: none; }

  .main {
    margin-left: 0;
    padding: calc(var(--top-h) + 14px) 12px calc(96px + env(safe-area-inset-bottom));
  }
  .view { max-width: none; }
  .row-head { margin-top: 24px; }
  .row-head h2 { font-size: 19px; }

  .pop { right: 8px; }
  .toasts { right: 12px; bottom: calc(92px + env(safe-area-inset-bottom) + var(--vv-bottom, 0px)); width: calc(100vw - 24px); align-items: stretch; }
  .toast { width: 100%; }
}

@media (max-width: 720px) {
  .hero { padding: 22px 20px 20px; min-height: 0; }
  .hero-title { margin-top: 10px; }
  .hero-sub { font-size: 16px; }
  .hero-mascot { width: 140px; height: 140px; }
  .hero-mascot:empty::after { inset: 28px; border-width: 9px; }
  .hero-actions .btn { flex: 1 1 auto; }
  .hero-stats { margin: 16px 0 18px; }
  .hstat { min-width: 0; flex: 1 1 0; }
}

@media (max-width: 520px) {
  .logo-text { font-size: 19px; }
  .logo-cube { width: 24px; height: 24px; }
  .top { gap: 6px; }
  .top-right { gap: 2px; }
  #top-headshot { display: none; }
  .icon-btn { width: 34px; height: 34px; }
  .balance { height: 34px; }
  .balance-val { font-size: 15px; }
  .dot { top: 4px; right: 4px; }
  .game-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
  .game, .shelf-games .game { width: 164px; }
  .game-ic .ic { width: 38%; height: 38%; }
  .game > h3 { font-size: 14px; }
  .skel-game { width: 164px; height: 230px; }
  .pool, .skel-pool { width: min(300px, 86vw); }
  .panel { padding: 16px; }
  .panel-head { flex-wrap: wrap; }
  .panel-head > .btn { margin-left: 0; }
  .dice-stage { gap: 18px; padding: 16px; justify-content: center; }
  .dice-roll { width: 110px; height: 110px; font-size: 40px; }
  .dice-meter { flex-basis: 100%; }
  .profile-card { padding: 18px 16px; }
  .pc-avatar { width: 84px; height: 84px; }
  .pc-wallet { width: 100%; }
  .pcw { flex: 1 1 0; min-width: 0; }
  .odds { gap: 6px; }
  .odds > div { padding: 8px 4px; }
  .odds b { font-size: 17px; }
  .bet { grid-template-columns: 1fr auto; }
  .bet .pick { display: none; }
  .modal-box { padding: 18px; }
  .pop { width: calc(100vw - 16px); }
}

@media (max-width: 400px) {
  .logo-text { display: none; }
  .balance-chip { display: none; }
  .balance { padding: 0 10px; }
  .top-right .icon-btn[id="btn-settings"] { display: none; }
  .avatar-btn { display: none; }
}

/* ===================== движение и доступность ===================== */
body.reduce-motion *,
body.reduce-motion *::before,
body.reduce-motion *::after {
  animation-duration: .01ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: .01ms !important;
  scroll-behavior: auto !important;
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}
@media (hover: none) {
  .game-ic::after { opacity: 1; transform: translate(-50%, 0); }
}
@media (prefers-contrast: more) {
  :root { --border: #6B6E71; --border-2: #8A8C8E; --text-3: #BDBEBE; }
}

/* ===================== обложки, персонажи, живые игры ===================== */
.game-ic.has-thumb { background: #101214; }
.game-ic.has-thumb::before { display: none; }
.game-ic.has-thumb > svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.pill.live { background: rgba(247, 75, 75, .16); color: var(--red-ink); text-transform: uppercase; letter-spacing: .04em; font-weight: 800; }
.pill.live::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 5px; border-radius: 50%; background: var(--red); vertical-align: 1px; }
.hero-av { position: absolute; inset: 10px 40px 0; display: grid; place-items: end center; }
.hero-av svg { width: 100%; height: 100%; filter: drop-shadow(0 18px 24px rgba(0, 0, 0, .45)); }
.rbx-headshot svg { background: linear-gradient(160deg, #3A3D40, #26282A); }

/* На телефоне снизу — панель хода, купон и нижняя навигация: уведомления
   там закрывали бы кнопки. Показываем их сверху, под шапкой. */
@media (max-width: 860px) {
  .toasts { top: calc(var(--top-h) + 8px); bottom: auto; left: 16px; right: 16px; width: auto; align-items: stretch; }
}
