:root {
  --bg: #07070a;
  --panel: #111116;
  --panel2: #17171d;
  --line: rgba(255, 255, 255, 0.11);
  --muted: #a7a8b3;
  --violet: #8d67ff;
  --violet2: #c0adff;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

html {
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}

body {
  font-size: 14px;
  line-height: 1.35;
}

button,
input,
select {
  -webkit-tap-highlight-color: transparent;
}

button {
  min-height: 44px;
  touch-action: manipulation;
}

input:not([type="checkbox"]):not([type="range"]),
select {
  min-height: 44px;
  font-size: 16px !important;
}

button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(185, 163, 255, 0.52);
  outline-offset: 2px;
}

button:disabled {
  cursor: default;
}

.app-shell {
  max-width: 480px;
}

.topbar {
  min-height: 78px;
  height: auto;
  padding: calc(10px + env(safe-area-inset-top, 0px)) 16px 10px;
}

.brand,
.round-btn,
.balance-pill {
  min-height: 44px;
}

.brand-mark,
.round-btn {
  width: 44px;
  height: 44px;
}

.brand-mark,
.brand-mark img {
  border-radius: 14px;
}

.brand b {
  font-size: 16px;
}

.brand small,
.balance-pill small,
.splash-logo span {
  font-size: 11px;
}

.balance-pill {
  height: 44px;
  padding-inline: 12px;
}

.balance-pill b {
  font-size: 14px;
}

.content {
  padding: 8px 16px calc(118px + var(--safe-bottom));
}

.page-stack {
  gap: 16px;
}

.page-stack > *,
.metrics-grid > *,
.deposit-strip > *,
.quick-grid > *,
.bonus-grid > *,
.games-grid > *,
.asset-choice > *,
.ref-main > *,
.balance-grid > * {
  min-width: 0;
  max-width: 100%;
}

.metrics-grid,
.deposit-strip {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.quick-grid,
.bonus-grid,
.games-grid,
.asset-choice,
.ref-main,
.balance-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.bottom-nav {
  width: min(calc(100% - 20px), 458px);
  min-height: 78px;
  height: auto;
  padding: 8px;
  border-radius: 25px;
  background: rgba(18, 18, 24, 0.9);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.52);
}

.nav-item {
  min-height: 58px;
  gap: 5px;
}

.nav-item small {
  font-size: 11px;
  font-weight: 550;
}

.nav-item.nav-exchange span {
  width: 48px;
  height: 48px;
  margin-top: -25px;
  border-radius: 17px;
}

.hero-card,
.card,
.rate-panel,
.queue-card,
.operator-strip,
.history-card,
.payment-card {
  border-color: var(--line);
}

.card,
.payment-card {
  padding: 18px;
}

.home-hero {
  min-height: 258px;
  padding: 20px;
}

.eyebrow,
.queue-mini,
.hero-rate small,
.hero-rate span {
  font-size: 12px;
}

.hero-rate > b {
  font-size: clamp(40px, 11vw, 46px);
  font-variant-numeric: tabular-nums;
}

.home-hero > .primary {
  width: 172px;
  height: 48px;
  font-size: 14px;
}

.metric {
  min-height: 88px;
  height: auto;
  padding: 12px 6px;
}

.metric b {
  font-size: 20px;
  font-variant-numeric: tabular-nums;
}

.metric span,
.status-line span,
.status-line small,
.tier-line,
.ref-main span,
.deposit-card small,
.action-row small,
.rate-panel small,
.rate-panel span,
.switch-row small,
.calc-output span,
.queue-card small,
.operator-strip small,
.asset-choice small,
.requisite small,
.history-copy > span,
.wheel-feature p,
.bonus-copy small,
.game-copy small,
.box-banner small,
.box-banner span,
.reward-card span,
.reward-card small,
.task-card span,
.task-card small,
.competition-hero small,
.competition-hero p,
.insurance-hero p,
.referral-hero small,
.insurance-hero > small,
.deposit-hero small,
.deposit-hero span,
.payment-head small,
.notification small,
.sheet-head small,
.balance-main span,
.balance-grid span,
.game-head span,
.game-head small,
.pvp-timer span,
.pvp-timer small,
.pvp-entry span,
.demo-note,
.setup-note,
.limit-note {
  font-size: 12px;
  line-height: 1.4;
}

.section-head {
  margin-bottom: 16px;
  gap: 12px;
}

.section-head > * {
  min-width: 0;
}

.section-head h2 {
  font-size: 17px;
  letter-spacing: -0.25px;
}

.status-chip,
.fair-chip,
.accent-text,
.status,
.bonus-copy > span,
.game-copy span {
  font-size: 11px;
  line-height: 1.25;
}

.status-chip,
.fair-chip {
  padding: 7px 9px;
}

.status-line b {
  font-size: 22px;
}

.status-line {
  gap: 12px;
}

.status-line > div {
  min-width: 0;
}

.status-line strong {
  flex: 0 0 auto;
  text-align: right;
}

.status-line strong,
.balance-grid b,
.payment-head b {
  font-size: 14px;
}

.progress {
  height: 6px;
}

.ref-main > div {
  min-height: 70px;
  padding: 14px;
}

.ref-main b {
  font-size: 17px;
}

.copy-field,
.copy-field.big {
  min-height: 48px;
  height: auto;
}

.copy-field code {
  font-size: 12px;
}

.text-btn {
  min-width: 44px;
  min-height: 44px;
  padding: 0 4px;
  font-size: 12px;
}

.deposit-card {
  min-height: 116px;
  padding: 14px;
}

.deposit-card b,
.switch-row b,
.queue-card b,
.operator-strip b,
.asset-choice b,
.requisite b,
.history-copy b,
.history-card > strong,
.task-card b,
.notification b {
  font-size: 14px;
}

.asset-choice button small {
  font-size: 12px;
}

.action-row {
  min-height: 64px;
  padding: 10px 12px;
}

.action-row b {
  font-size: 13px;
}

.row-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
}

.page-title {
  padding: 10px 2px 6px;
}

.page-title > small {
  font-size: 11px;
}

.page-title h1 {
  margin-top: 6px;
  font-size: 32px;
  line-height: 1.12;
  letter-spacing: -1.1px;
}

.page-title p,
.muted,
.empty-hint p {
  max-width: 390px;
  font-size: 13px;
  line-height: 1.5;
}

.segmented button {
  height: 44px;
  font-size: 14px;
}

.rate-panel {
  min-height: 160px;
  padding: 20px;
}

.rate-panel b {
  font-size: 40px;
  font-variant-numeric: tabular-nums;
}

.switch-row {
  min-height: 48px;
  gap: 12px;
}

.switch-row > i {
  flex: 0 0 auto;
}

.notice {
  padding: 12px 13px;
  font-size: 12px;
  line-height: 1.5;
}

.calculator label,
.field-label,
.bet-row > label,
.game-panel > .field-label {
  font-size: 13px;
  line-height: 1.35;
}

.amount-input,
.amount-input.compact {
  min-height: 52px;
  height: auto;
}

.amount-input span {
  font-size: 13px;
}

.calc-output {
  min-height: 58px;
  padding: 14px;
}

.calc-output b {
  font-size: 18px;
  font-variant-numeric: tabular-nums;
}

.queue-card,
.operator-strip {
  min-height: 64px;
  padding: 12px 14px;
}

.operator-avatar {
  width: 40px;
  height: 40px;
  font-size: 13px;
}

.ticker {
  height: 40px;
}

.ticker span,
.ticker b,
.live {
  font-size: 12px;
}

.asset-choice button {
  min-height: 96px;
  height: auto;
}

.form-grid input,
.form-grid select,
.text-input,
.two-field input,
.two-field select {
  min-height: 48px;
  height: auto;
}

.summary-row,
.summary-total span,
.agreement span,
.info-row {
  font-size: 13px;
  line-height: 1.45;
}

.agreement {
  min-height: 52px;
  align-items: center;
}

.agreement > i {
  width: 24px;
  height: 24px;
}

.history-card {
  min-height: 70px;
  padding: 13px;
}

.history-icon {
  width: 42px;
  height: 42px;
}

.wheel-feature {
  min-height: 180px;
  padding: 20px;
}

.wheel-feature span {
  font-size: 11px;
}

.wheel-feature b {
  font-size: 27px;
}

.wheel-feature b small,
.br-art span {
  font-size: 11px;
}

.bonus-grid,
.games-grid {
  gap: 10px;
}

.bonus-banner {
  min-height: 158px;
  height: auto;
  padding: 16px;
}

.bonus-copy b {
  font-size: 17px;
}

.game-banner {
  min-height: 210px;
  height: auto;
}

.game-copy {
  padding: 16px;
}

.game-copy b {
  font-size: 18px;
}

.game-head {
  min-height: calc(72px + env(safe-area-inset-top, 0px));
  padding-top: env(safe-area-inset-top, 0px);
}

.back-btn,
.fair-btn {
  width: 44px;
  height: 44px;
}

.game-head h1 {
  font-size: 20px;
}

.game-panel {
  margin: 12px 16px;
  padding: 16px;
}

.chips {
  gap: 8px;
}

.chips button,
.task-card button {
  min-height: 44px;
  height: auto;
  font-size: 12px;
}

.fair-line {
  min-height: 44px;
  padding: 10px 12px;
}

.fair-line span,
.fair-line code,
.fair-line b,
.my-bet,
.result-chip,
.winner-chip,
.wheel-empty {
  font-size: 11px;
}

.round-state,
.plinko-slots span,
.ladder-step,
.wheel-page-card p {
  font-size: 11px;
}

.plinko-slots span {
  min-height: 28px;
}

.pvp-entry b,
.box-banner b {
  font-size: 15px;
}

.box-banner {
  min-height: 154px;
  height: auto;
}

.task-card {
  min-height: 76px;
  padding: 14px;
}

.leaderboard > div {
  min-height: 48px;
  height: auto;
  font-size: 13px;
}

.leaderboard b,
.leaderboard strong {
  font-size: 13px;
}

.timer,
.large-wheel span,
.crash-history span {
  font-size: 11px;
}

input[type="range"] {
  min-height: 44px;
  touch-action: pan-x;
}

.ton-preview {
  min-height: 48px;
  height: auto;
  padding: 10px 12px;
  font-size: 12px;
  line-height: 1.4;
  text-align: center;
}

.sheet {
  padding: 10px 18px calc(24px + var(--safe-bottom));
  background: rgba(18, 18, 23, 0.98);
}

.sheet-head h2 {
  font-size: 22px;
}

.tiny-btn {
  min-height: 44px;
  font-size: 12px;
}

.toast {
  padding: 13px 15px;
  font-size: 13px;
  line-height: 1.4;
}

.fatal p {
  font-size: 13px;
}

@media (max-width: 365px) {
  .content {
    padding-inline: 12px;
  }

  .topbar {
    padding-inline: 12px;
  }

  .brand > span:last-child {
    display: none;
  }

  .metrics-grid,
  .deposit-strip,
  .quick-grid,
  .bonus-grid,
  .games-grid {
    gap: 8px;
  }

  .game-copy {
    padding: 13px;
  }

  .game-copy b {
    font-size: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
