/* Navy Voltage — новая система, не наследник старой вёрстки.
   Фон almost-black navy, акцент electric blue, glow только у иерархии. */

:root {
  color-scheme: dark;

  --bg: #080910;
  --bg-2: #0b0d15;
  --surf: #0e101a;
  --surf-2: #121624;
  --surf-3: #171d2e;
  --text: #f4f7ff;
  --text-2: #8b93a7;
  --text-3: #5c6478;
  --blue: #2f6bff;
  --blue-2: #3d8bff;
  --blue-3: #1d4ed8;
  --on-blue: #ffffff;
  --ok: #3ddc97;
  --warn: #f5c14a;
  --err: #ff5c71;
  --gold: #f0d18a;

  --line: rgba(244, 247, 255, 0.06);
  --line-2: rgba(244, 247, 255, 0.12);
  --blue-a: rgba(47, 107, 255, 0.18);
  --blue-b: rgba(47, 107, 255, 0.08);
  --ok-a: rgba(61, 220, 151, 0.12);
  --ok-l: rgba(61, 220, 151, 0.34);
  --err-a: rgba(255, 92, 113, 0.12);
  --err-l: rgba(255, 92, 113, 0.34);
  --warn-a: rgba(245, 193, 74, 0.12);
  --gold-a: rgba(240, 209, 138, 0.12);
  --gold-l: rgba(240, 209, 138, 0.28);

  --glow: 0 0 36px rgba(47, 107, 255, 0.38);
  --glow-sm: 0 0 18px rgba(47, 107, 255, 0.22);
  --inset: 0 1px 0 rgba(255, 255, 255, 0.04) inset;
  --shade: 0 18px 40px rgba(0, 0, 0, 0.42);

  --r: 20px;
  --r-sm: 12px;
  --space: 16px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --dock-h: 68px;

  --font: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --display: "Outfit", "Manrope", -apple-system, sans-serif;
  --lore: "Fraunces", "Outfit", Georgia, serif;

  --ease: cubic-bezier(.2, .8, .2, 1);
  --spring: cubic-bezier(.2, .85, .25, 1);
  --screen-h: 100vh;
}

@supports (height: 100dvh) {
  :root { --screen-h: 100dvh; }
}
:root { --viewport-h: var(--tg-viewport-stable-height, var(--screen-h)); }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }

html, body {
  margin: 0; padding: 0; height: 100%;
  color: var(--text);
  font: 400 15px/1.45 var(--font);
  overscroll-behavior-y: none;
  -webkit-font-smoothing: antialiased;
}
body { overflow: hidden; background: var(--bg); }

.atmosphere {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(90% 55% at 50% -18%, rgba(47, 107, 255, 0.22), transparent 58%),
    radial-gradient(50% 36% at 108% 18%, rgba(61, 139, 255, 0.08), transparent 50%),
    var(--bg);
}
.atmosphere__orb {
  position: fixed; left: 50%; top: 18%;
  width: 280px; height: 280px; margin-left: -140px;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 32%, rgba(90, 150, 255, 0.28), rgba(20, 40, 90, 0.08) 46%, transparent 70%);
  filter: blur(8px);
  pointer-events: none; z-index: 0;
  animation: orb-drift 12s var(--ease) infinite alternate;
}
@keyframes orb-drift {
  from { transform: translateY(0) scale(1); opacity: .7; }
  to { transform: translateY(18px) scale(1.06); opacity: 1; }
}

button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }
a { color: var(--blue-2); text-decoration: none; }
::selection { background: var(--blue-a); color: var(--text); }

.screen::-webkit-scrollbar,
.sheet__body::-webkit-scrollbar { width: 3px; }
.screen::-webkit-scrollbar-thumb,
.sheet__body::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 999px; }

/* ----- boot / fatal ----- */

.boot, .fatal {
  position: fixed; inset: 0; z-index: 30;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 18px; padding: 32px; text-align: center;
  background: var(--bg);
}
.fatal { z-index: 40; }
.boot__text, .fatal__text { color: var(--text-2); margin: 0; max-width: 32ch; font-size: 14px; }
.fatal__icon { display: flex; justify-content: center; }
.fatal__icon .ico-svg { width: 48px; height: 48px; }
.fatal__title {
  font-family: var(--display);
  font-size: 28px; font-weight: 800; letter-spacing: -.04em; margin: 0;
}
.fatal__actions { display: flex; flex-direction: column; gap: 8px; width: 100%; max-width: 320px; }

.orb {
  width: 88px; height: 88px; border-radius: 50%;
  background:
    radial-gradient(circle at 32% 28%, #9ec2ff, #2f6bff 42%, #0a1a44 75%);
  box-shadow: var(--glow), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.orb--boot { animation: orb-spin 2.4s linear infinite; }
@keyframes orb-spin { to { transform: rotate(360deg); } }

/* ----- app chrome ----- */

.app { display: flex; flex-direction: column; height: 100%; min-height: 0; position: relative; z-index: 2; }

.hud {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  padding: calc(var(--safe-t) + 8px) 18px 0;
  flex: 0 0 auto;
}
.hud__who {
  display: flex; align-items: center; gap: 10px; min-width: 0;
  max-width: calc(100% - 7.2rem);
  padding: 4px 0;
  text-align: left;
}
.hud__who:active { opacity: .75; }
.hud__meta { min-width: 0; }
.hud__name {
  font-family: var(--display);
  font-weight: 700; font-size: 15px; letter-spacing: -.02em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.hud__sub {
  color: var(--text-3); font-size: 11px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.hud__cash {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 11px; border-radius: 999px;
  background: var(--surf);
  border: 1px solid var(--line-2);
  font-family: var(--display);
  font-weight: 700; font-variant-numeric: tabular-nums;
  font-size: 13px; letter-spacing: -.02em;
}
.hud__cash:active { transform: scale(.96); }
.hud__cash.is-pulse { animation: cash-pulse .5s var(--spring); }
@keyframes cash-pulse {
  0% { transform: scale(1); }
  40% { transform: scale(1.06); box-shadow: var(--glow-sm); }
  100% { transform: scale(1); }
}
.hud__cash-ico { display: flex; }
.hud__cash-val { max-width: 28vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--surf-2) center/cover no-repeat;
  border: 1px solid var(--line-2);
  box-shadow: 0 0 0 2px rgba(47, 107, 255, 0.14);
  display: grid; place-items: center;
  font-family: var(--display); font-weight: 700; font-size: 13px;
  flex: 0 0 auto;
}
.avatar--lg { width: 56px; height: 56px; font-size: 20px; }

.screen {
  flex: 1 1 auto; overflow-y: auto; overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding: 18px 20px calc(var(--dock-h) + var(--safe-b) + 20px);
  outline: none;
}
.screen.is-enter { animation: rise .34s var(--ease); }
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

.dock {
  position: fixed; left: 12px; right: 12px; bottom: calc(var(--safe-b) + 8px);
  height: 58px;
  display: flex; align-items: stretch;
  padding: 4px;
  background: rgba(11, 13, 21, 0.88);
  border: 1px solid var(--line-2);
  border-radius: 22px;
  box-shadow: var(--shade);
  backdrop-filter: blur(22px) saturate(1.2);
  -webkit-backdrop-filter: blur(22px) saturate(1.2);
  z-index: 20;
}
.tab {
  flex: 1 1 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 2px;
  color: var(--text-3); font-size: 10px; font-weight: 650;
  min-width: 0; border-radius: 18px;
  transition: color .18s var(--ease), background .18s var(--ease);
}
.tab__icon { display: grid; place-items: center; width: 26px; height: 22px; }
.tab__label { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tab.is-active {
  color: var(--text);
  background: var(--blue-a);
  box-shadow: var(--glow-sm);
}
.tab:active { transform: scale(.96); }

.ico { display: inline-flex; align-items: center; justify-content: center; line-height: 0; font-size: 0; }
.ico-svg { display: block; width: 24px; height: 24px; overflow: visible; }
.tab__icon .ico-svg { width: 20px; height: 20px; }
.tile__icon .ico-svg { width: 22px; height: 22px; }
.row__icon .ico-svg { width: 20px; height: 20px; }
.hud__cash-ico .ico-svg { width: 15px; height: 15px; }
.empty__icon .ico-svg { width: 40px; height: 40px; }
.tour__icon .ico-svg { width: 42px; height: 42px; }
.result__value .ico-svg { width: 32px; height: 32px; }
.coin .ico-svg { width: 62px; height: 62px; }
.die .ico-svg { width: 42px; height: 42px; }
.mine-cell .ico-svg { width: 28px; height: 28px; }
.reel .ico-svg { width: 44px; height: 44px; }

/* ----- open composition (not a card wall) ----- */

.kicker {
  color: var(--text-3); font-size: 11px; font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase;
}
.hello { margin: 10px 0 4px; }
.hello__name {
  font-family: var(--display);
  font-size: 15px; font-weight: 600; color: var(--text-2);
}

.mega {
  margin: 6px 0 8px;
  font-family: var(--display);
  font-size: clamp(56px, 18vw, 76px);
  font-weight: 800; line-height: .88;
  letter-spacing: -.06em; font-variant-numeric: tabular-nums;
  text-shadow: 0 0 40px rgba(47, 107, 255, 0.35);
}
.mega--blue { color: var(--blue-2); }
.mega--sm { font-size: clamp(36px, 12vw, 52px); }
.mega-sub { color: var(--text-2); font-size: 13px; margin-bottom: 22px; }

.metrics {
  display: flex; gap: 22px; margin: 8px 0 28px;
}
.metric__n {
  font-family: var(--display);
  font-size: 22px; font-weight: 800; letter-spacing: -.03em;
  font-variant-numeric: tabular-nums;
}
.metric__l { color: var(--text-3); font-size: 11px; margin-top: 2px; letter-spacing: .04em; text-transform: uppercase; }

.cta {
  position: relative;
  width: 100%; min-height: 58px;
  border-radius: 18px;
  background: linear-gradient(180deg, #4d8cff 0%, var(--blue-3) 100%);
  color: var(--on-blue);
  font-family: var(--display);
  font-weight: 800; font-size: 16px; letter-spacing: -.02em;
  box-shadow: var(--glow), var(--inset);
  margin: 8px 0 10px;
  transition: transform .12s var(--spring), filter .15s ease;
}
.cta:active:not(:disabled) { transform: scale(.975); filter: brightness(.96); }
.cta:disabled { opacity: .4; box-shadow: none; }
.cta.is-live { animation: cta-breathe 2.2s var(--ease) infinite; }
@keyframes cta-breathe {
  0%, 100% { box-shadow: var(--glow); }
  50% { box-shadow: 0 0 48px rgba(47, 107, 255, 0.55); }
}

.live {
  display: flex; align-items: center; gap: 10px;
  margin: 4px 0 20px;
  color: var(--blue-2); font-size: 13px; font-weight: 650;
}
.live__dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--blue-2); box-shadow: 0 0 10px var(--blue-2);
  animation: blink 1.1s var(--ease) infinite;
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: .35; }
}

.pills { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0 4px; }
.pill {
  padding: 10px 14px; border-radius: 999px;
  background: var(--surf); border: 1px solid var(--line);
  font-size: 12.5px; font-weight: 650; color: var(--text-2);
  text-align: left;
}
.pill.is-ready {
  color: var(--ok); border-color: var(--ok-l); background: var(--ok-a);
}
.pill.is-off { opacity: .4; }
.pill:active { transform: scale(.97); }
.pill__t { display: block; color: var(--text); font-size: 13px; }
.pill__s { display: block; margin-top: 1px; font-size: 11px; }

/* ----- arena ----- */

.home-arena {
  min-height: calc(var(--viewport-h) - var(--dock-h) - var(--safe-b) - 72px);
  display: flex;
  flex-direction: column;
}

.core {
  position: relative;
  width: min(78vw, 300px);
  aspect-ratio: 1;
  margin: 0 auto 4px;
}
.core__glow {
  position: absolute;
  inset: 8%;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle, rgba(61, 139, 255, 0.32) 0%, transparent 70%);
  filter: blur(16px);
  animation: core-glow 5.6s ease-in-out infinite;
}
.core__art {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  animation: core-breathe 5.6s ease-in-out infinite;
}
.core--live .core__glow,
.core--live .core__art { animation-duration: 1.8s; }

@keyframes core-breathe {
  0%, 100% { transform: scale(1); filter: brightness(1); }
  50% { transform: scale(1.03); filter: brightness(1.08); }
}
@keyframes core-glow {
  0%, 100% { opacity: .45; transform: scale(.98); }
  50% { opacity: 1; transform: scale(1.06); }
}

.stage { text-align: center; padding: 6px 0 8px; }
.stage__title {
  font-family: var(--display);
  font-size: clamp(28px, 8vw, 40px); font-weight: 800;
  letter-spacing: -.04em; line-height: 1;
  margin: 4px 0 8px;
}
.stage__sub { color: var(--text-2); font-size: 13.5px; }

.lore {
  margin-top: auto;
  padding: 28px 8px 4px;
  text-align: center;
}
.lore__text {
  margin: 0;
  font-family: var(--lore);
  font-size: 16.5px;
  font-weight: 500;
  font-variation-settings: "opsz" 72, "SOFT" 50;
  font-style: italic;
  line-height: 1.45;
  letter-spacing: -.01em;
  color: #c5d0ea;
}

.duel {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; margin: 18px 0 20px;
}
.duel__side { width: 42%; min-width: 0; text-align: center; }
.duel__orb {
  width: 72px; height: 72px; margin: 0 auto 10px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 32% 28%, #c5daff, #2f6bff 46%, #0c1733 78%);
  border: 2px solid rgba(47, 107, 255, 0.45);
  box-shadow: var(--glow-sm);
  display: grid; place-items: center;
  font-family: var(--display); font-weight: 800; font-size: 24px;
}
.duel__side--them .duel__orb {
  background: radial-gradient(circle at 32% 28%, #2a3144, #121624 70%);
  border-color: var(--line-2);
  box-shadow: none;
}
.duel__name {
  font-weight: 750; font-size: 14px; letter-spacing: -.02em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.duel__role { color: var(--text-3); font-size: 11px; margin-top: 2px; }
.duel__vs {
  font-family: var(--display);
  font-size: 12px; font-weight: 800; letter-spacing: .2em;
  color: var(--blue-2);
}

.board {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 8px; margin: 10px 0 22px;
}
.board__col { flex: 1; min-width: 0; text-align: center; }
.board__who {
  color: var(--text-3); font-size: 11px; font-weight: 650;
  letter-spacing: .06em; text-transform: uppercase;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.board__n {
  font-family: var(--display);
  font-size: clamp(32px, 10vw, 44px); font-weight: 800;
  letter-spacing: -.045em; font-variant-numeric: tabular-nums;
  line-height: 1; margin: 6px 0 4px;
}
.board__col.is-win .board__n {
  color: var(--blue-2);
  text-shadow: 0 0 28px rgba(47, 107, 255, 0.5);
}
.board__rank { color: var(--text-2); font-size: 12px; }
.board__mid {
  flex: 0 0 auto; color: var(--text-3); font-size: 12px; font-weight: 700;
  padding-bottom: 20px;
}

.win-line {
  font-family: var(--display);
  font-size: clamp(34px, 10vw, 48px); font-weight: 800;
  letter-spacing: -.045em; line-height: .95;
  text-align: center; margin: 8px 0 6px;
  text-shadow: 0 0 36px rgba(47, 107, 255, 0.45);
}
.win-line.is-lose { text-shadow: none; color: var(--err); }
.win-line.is-draw { text-shadow: none; color: var(--text-2); }
.win-sub { text-align: center; color: var(--text-2); font-size: 14px; margin-bottom: 18px; }

.scales { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 14px; }
.scale {
  padding: 6px 10px; border-radius: 999px;
  background: var(--surf); border: 1px solid var(--line);
  font-size: 11.5px; font-weight: 650; color: var(--text-2);
  font-variant-numeric: tabular-nums;
}

.battle-card {
  display: block; width: 100%; height: auto;
  border-radius: var(--r); margin: 8px 0 16px;
  border: 1px solid var(--line-2);
}
.battle-card--loading {
  aspect-ratio: 4 / 3;
  background: linear-gradient(90deg, var(--surf) 25%, #182038 37%, var(--surf) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.3s ease infinite;
}

/* ----- shared primitives for other screens ----- */

.section-title {
  font-size: 11px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--text-3); font-weight: 700;
  margin: 22px 0 10px;
}
.section-title:first-child { margin-top: 2px; }

.card {
  background: var(--surf);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--inset);
}
.card--flat { background: transparent; border: none; padding: 0; box-shadow: none; }

.hero { text-align: left; padding: 8px 0 12px; background: none; border: none; box-shadow: none; margin: 0; }
.hero__label { color: var(--text-3); font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; display: flex; align-items: center; gap: 6px; }
.hero__label .ico-svg { width: 16px; height: 16px; }
.hero__value {
  font-family: var(--display);
  font-size: clamp(32px, 10vw, 48px); font-weight: 800; line-height: 1;
  margin: 8px 0 6px; letter-spacing: -.04em; font-variant-numeric: tabular-nums;
  display: flex; align-items: center; gap: 8px;
}
.hero__value--sm { font-size: clamp(22px, 7vw, 32px); }
.hero__sub { color: var(--text-2); font-size: 13px; }

.rows { display: flex; flex-direction: column; }
.row {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 0; border-bottom: 1px solid var(--line);
  text-align: left; width: 100%;
}
.row:last-child { border-bottom: none; }
.row__icon {
  width: 36px; height: 36px; border-radius: 11px;
  display: grid; place-items: center; flex: 0 0 auto;
  background: var(--surf-2); border: 1px solid var(--line);
}
.row__body { flex: 1 1 auto; min-width: 0; }
.row__title { font-weight: 700; letter-spacing: -.015em; font-size: 14.5px; }
.row__sub { color: var(--text-2); font-size: 12.5px; margin-top: 2px; }
.row__value {
  font-family: var(--display);
  font-weight: 750; font-variant-numeric: tabular-nums;
  flex: 0 0 auto; letter-spacing: -.02em;
}
.row__chevron { color: var(--text-3); flex: 0 0 auto; font-size: 18px; }
button.row:active { opacity: .7; transform: scale(.995); }
.row.is-disabled { opacity: .4; pointer-events: none; }
.row__actions { display: flex; flex-direction: column; gap: 6px; flex: 0 0 auto; min-width: 104px; }
.row__actions .btn { width: 100%; }

.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.grid--3 { grid-template-columns: repeat(3, 1fr); gap: 8px; }
.grid--3 .tile { min-height: 76px; padding: 12px 10px; }

.tile {
  background: var(--surf); border: 1px solid var(--line);
  border-radius: 16px; padding: 14px 12px;
  display: flex; flex-direction: column; gap: 6px;
  align-items: flex-start; text-align: left; min-height: 88px;
  justify-content: center;
}
.tile:active { transform: scale(.975); }
.tile__icon {
  width: 34px; height: 34px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: var(--surf-2); border: 1px solid var(--line);
}
.tile__title { font-weight: 700; font-size: 13.5px; }
.tile__sub { color: var(--text-2); font-size: 11.5px; }
.tile.is-ready { border-color: var(--ok-l); background: var(--ok-a); }
.tile.is-ready .tile__sub { color: var(--ok); }
.tile.is-disabled { opacity: .4; }

.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat { text-align: left; }
.stat__value {
  font-family: var(--display);
  font-weight: 800; font-size: 20px;
  font-variant-numeric: tabular-nums; letter-spacing: -.03em;
}
.stat__label { color: var(--text-3); font-size: 11px; margin-top: 2px; text-transform: uppercase; letter-spacing: .04em; }

.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; min-height: 52px; padding: 13px 16px; border-radius: 16px;
  background: linear-gradient(180deg, #4d8cff, var(--blue-3));
  color: var(--on-blue);
  font-family: var(--display);
  font-weight: 750; font-size: 15px; letter-spacing: -.015em;
  box-shadow: var(--glow-sm);
  transition: transform .12s var(--ease);
}
.btn:active:not(:disabled) { transform: scale(.975); }
.btn:disabled { opacity: .4; box-shadow: none; }
.btn--ghost {
  background: transparent; color: var(--text);
  border: 1px solid var(--line-2); box-shadow: none;
}
.btn--danger {
  background: linear-gradient(180deg, #e25568, #bf3346);
  box-shadow: none;
}
.btn--sm { min-height: 40px; padding: 9px 12px; font-size: 13.5px; border-radius: 12px; box-shadow: none; }
.btn + .btn,
.cta + .btn { margin-top: 8px; }
.btn-row { display: flex; gap: 8px; }
.btn-row .btn { margin-top: 0; }
.btn__spin {
  width: 15px; height: 15px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .35); border-top-color: currentColor;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.field { margin-bottom: 12px; }
.field__label {
  display: block; color: var(--text-3); font-size: 11px; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase; margin-bottom: 7px;
}
.input {
  width: 100%; padding: 14px;
  border-radius: 14px;
  background: var(--bg-2); border: 1px solid var(--line);
  font-variant-numeric: tabular-nums;
}
.input::placeholder { color: var(--text-3); }
.input:focus {
  outline: none; border-color: rgba(47, 107, 255, 0.55);
  box-shadow: 0 0 0 3px var(--blue-b);
}
select.input { appearance: none; }

.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  padding: 8px 13px; border-radius: 999px;
  background: var(--surf); border: 1px solid var(--line);
  font-size: 13px; font-weight: 650;
}
.chip.is-active {
  background: var(--blue); color: var(--on-blue); border-color: transparent;
  box-shadow: var(--glow-sm);
}
.chip--zero { border-color: var(--ok-l); color: var(--ok); }
.chip--zero.is-active { background: var(--ok); color: #062; }
.chip:active { transform: scale(.95); }

.badge {
  display: inline-flex; align-items: center;
  padding: 3px 8px; border-radius: 999px;
  font-size: 11px; font-weight: 700;
  background: var(--blue-a); color: var(--blue-2);
}
.badge--ok { background: var(--ok-a); color: var(--ok); }
.badge--warn { background: var(--warn-a); color: var(--warn); }
.badge--muted { background: var(--surf-2); color: var(--text-3); }

.progress { height: 4px; border-radius: 999px; background: var(--blue-b); overflow: hidden; margin-top: 10px; }
.progress__bar { height: 100%; border-radius: 999px; background: var(--blue-2); }

.empty { text-align: center; padding: 48px 16px; color: var(--text-2); }
.empty__icon {
  width: 64px; height: 64px; margin: 0 auto 12px;
  border-radius: 50%;
  background: var(--surf); border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
}
.empty__title {
  font-family: var(--display);
  color: var(--text); font-weight: 800; font-size: 20px;
  letter-spacing: -.03em; margin-bottom: 6px;
}

.skeleton {
  background: linear-gradient(90deg, var(--surf) 22%, #182038 38%, var(--surf) 54%);
  background-size: 400% 100%;
  animation: shimmer 1.25s ease infinite;
  border-radius: 16px;
}
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }
.skeleton--hero { height: 120px; margin-bottom: 14px; }
.skeleton--row { height: 56px; margin-bottom: 10px; }

.note { color: var(--text-3); font-size: 12.5px; margin-top: 10px; }
.note--tight { margin-top: 4px; }
.mono { font-family: ui-monospace, Menlo, monospace; font-size: 12.5px; word-break: break-all; color: var(--blue-2); }
.win { color: var(--ok); }
.lose { color: var(--err); }

.profile-head { padding: 0; background: none; border: none; box-shadow: none; }
.profile-head__row { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.profile-head__who { min-width: 0; flex: 1; }
.profile-head__name { font-family: var(--display); font-weight: 750; font-size: 22px; letter-spacing: -.03em; }
.profile-head__sub { color: var(--text-2); font-size: 13px; margin-top: 2px; }
.profile-head__money { padding-top: 8px; }
.streak-card {
  display: flex; align-items: center; gap: 12px;
  margin: 10px 0 16px; padding: 0;
  background: none; border: none;
}
.streak-card__icon { display: grid; place-items: center; }
.streak-card__icon .ico-svg { width: 24px; height: 24px; }
.streak-card__value { font-weight: 750; font-size: 15px; }
.streak-card__sub { color: var(--text-2); font-size: 12px; }

/* ----- games ----- */

.reels {
  display: flex; justify-content: center; gap: 12px;
  padding: 20px 12px 14px; min-height: 96px;
  border-radius: 18px;
  background: var(--surf); border: 1px solid var(--line);
}
.reel {
  width: 74px; height: 74px;
  display: grid; place-items: center;
  border-radius: 16px;
  background: var(--surf-2); border: 1px solid var(--line-2);
}
.reel.is-spinning { animation: roll .18s linear infinite; border-color: var(--blue); }
.reel.is-land { animation: reel-land .42s var(--spring); }
@keyframes roll {
  0% { transform: translateY(-7px); opacity: .5; }
  50% { opacity: 1; }
  100% { transform: translateY(7px); opacity: .75; }
}
@keyframes reel-land {
  0% { transform: scale(.86); }
  60% { transform: scale(1.06); }
  100% { transform: scale(1); }
}
.slots-out { opacity: 0; transform: translateY(8px); transition: opacity .35s ease, transform .35s var(--ease); }
.slots-out--show { opacity: 1; transform: none; }

.coin, .die, .wheel { display: grid; place-items: center; margin: 6px auto 12px; }
.coin {
  width: 100px; height: 100px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffe9b0, #c4923a 60%, #3a2a14);
  border: 2px solid var(--gold-l);
}
.die {
  width: 88px; height: 88px; border-radius: 22px;
  background: var(--surf-2); border: 2px solid var(--line-2); font-size: 40px;
}
.wheel { width: 100px; height: 100px; border-radius: 50%; font-size: 30px; color: #fff; display: grid; place-items: center; }
.wheel--red { background: #d1364a; }
.wheel--black { background: #0b0d15; border: 2px solid var(--line-2); }
.wheel--green { background: #1f8a4c; }
.is-flip { animation: flip .5s ease; }
@keyframes flip { 0% { transform: rotateY(0) scale(.9); } 100% { transform: rotateY(720deg) scale(1); } }

.mines-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 7px; margin: 12px 0; }
.mine-cell {
  aspect-ratio: 1; border-radius: 12px;
  background: var(--surf); border: 1px solid var(--line);
  display: grid; place-items: center;
}
.mine-cell:active:not(:disabled) { transform: scale(.94); }
.mine-cell.is-open { background: var(--ok-a); border-color: var(--ok-l); }
.mine-cell.is-bomb { background: var(--err-a); border-color: var(--err-l); }
.mine-cell.is-boom { background: var(--err); }

.hand { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0 2px; }
.pcard {
  min-width: 44px; padding: 10px 8px; border-radius: 12px;
  background: #eef3ff; color: #0c1220;
  font-weight: 750; font-size: 15px; text-align: center;
}
.pcard--red { color: #cf2f45; }
.pcard--hidden { background: var(--surf); color: var(--text-3); border: 1px solid var(--line); }
.hand-label { color: var(--text-2); font-size: 12px; }
.hand-score { font-weight: 700; font-variant-numeric: tabular-nums; }

.result {
  border-radius: var(--r); padding: 8px 0 16px;
  background: none; border: none; text-align: left;
  animation: rise .35s var(--ease);
}
.result--win .result__value { color: var(--blue-2); text-shadow: 0 0 24px rgba(47, 107, 255, 0.4); }
.result--lose .result__value { color: var(--err); }
.result__value {
  font-family: var(--display);
  font-size: 32px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.03em;
}
.result__text { color: var(--text-2); font-size: 13px; margin-top: 4px; }

.toasts {
  position: fixed; left: 16px; right: 16px;
  bottom: calc(var(--dock-h) + var(--safe-b) + 8px);
  display: flex; flex-direction: column; gap: 8px;
  z-index: 140; pointer-events: none;
}
.toast {
  background: var(--surf-2); border: 1px solid var(--line-2);
  border-radius: 14px; padding: 13px 15px;
  font-size: 13.5px; font-weight: 600;
  animation: rise .3s var(--ease);
}
.toast--error { border-color: var(--err-l); }
.toast--ok { border-color: var(--ok-l); }
.toast--out { opacity: 0; transform: translateY(8px); }

.sheet { position: fixed; inset: 0; z-index: 100; display: flex; align-items: flex-end; }
.sheet__backdrop {
  position: absolute; inset: 0;
  background: rgba(4, 6, 12, .78);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.sheet__panel {
  position: relative; width: 100%;
  display: flex; flex-direction: column;
  max-height: min(88vh, max(50vh, calc(var(--viewport-h) - 18px)));
  overflow: hidden;
  background: var(--surf-2);
  border-top: 1px solid var(--line-2);
  border-radius: 28px 28px 0 0;
  padding: 8px 18px calc(var(--safe-b) + 16px);
}
.sheet__grip {
  width: 36px; height: 4px; border-radius: 999px;
  background: var(--line-2); margin: 6px auto 12px;
}
.sheet__title {
  font-family: var(--display);
  font-size: 22px; font-weight: 800; letter-spacing: -.03em;
  margin: 0 0 14px;
}
.sheet__title:empty { display: none; }
.sheet__body { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
.sheet--tour .sheet__panel { min-height: min(48vh, 372px); }
.sheet--tour .sheet__body { display: flex; flex-direction: column; overflow: hidden; }

.tour-wrap { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }
.tour { display: flex; flex-direction: column; justify-content: center; flex: 1; text-align: center; }
.tour__icon { margin-bottom: 10px; display: flex; justify-content: center; }
.tour__title { font-family: var(--display); font-size: 22px; font-weight: 800; letter-spacing: -.03em; margin-bottom: 8px; }
.tour__text { color: var(--text-2); font-size: 14px; line-height: 1.5; overflow-y: auto; }
.tour__foot { flex: 0 0 auto; padding-top: 4px; }
.tour__dots { display: flex; justify-content: center; gap: 6px; margin: 14px 0 12px; }
.tour__dot { width: 6px; height: 6px; border-radius: 50%; background: var(--blue-b); }
.tour__dot.is-active { background: var(--blue); width: 18px; border-radius: 999px; }

.list-num { color: var(--text-3); width: 20px; flex: 0 0 auto; font-variant-numeric: tabular-nums; }
.sheet-fade { animation: rise .28s var(--ease); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
@media (max-width: 360px) {
  .mega { font-size: 48px; }
  .hud__cash-val { max-width: 24vw; }
  .dock { left: 8px; right: 8px; }
}
@media (max-height: 620px) {
  .core { width: min(58vw, 200px); }
  .mega { font-size: 48px; }
  .cta, .btn { min-height: 48px; }
}
