:root {
  color-scheme: light;
  --bg: #f7f9fc;
  --surface: rgba(255, 255, 255, 0.88);
  --surface-strong: #ffffff;
  --text: #121826;
  --muted: #687386;
  --line: rgba(39, 57, 82, 0.12);
  --line-strong: rgba(23, 179, 209, 0.28);
  --accent: #12a7c8;
  --accent-strong: #087b98;
  --green: #19a974;
  --button-text: #ffffff;
  --shadow: 0 18px 42px rgba(26, 42, 68, 0.10);
  --soft-shadow: 0 10px 28px rgba(26, 42, 68, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
  background:
    linear-gradient(180deg, rgba(18, 167, 200, 0.08), rgba(247, 249, 252, 0) 34%),
    radial-gradient(circle at 50% 0, rgba(255, 255, 255, 0.96), rgba(247, 249, 252, 0) 42%),
    var(--bg);
}

.shell {
  width: min(720px, 100%);
  margin: 0 auto;
  padding: 16px 14px 104px;
  position: relative;
}

.particle-field {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
  opacity: 0.42;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.78), transparent 86%);
}

.particle {
  position: absolute;
  width: var(--size);
  height: var(--size);
  transform: translate3d(0, 0, 0);
  animation: particle-float var(--duration) ease-in-out var(--delay) infinite alternate;
}

.particle::before,
.particle::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 100%;
  height: 1.5px;
  border-radius: 999px;
  background: rgba(18, 24, 38, 0.22);
  transform: translate(-50%, -50%);
}

.particle::after {
  transform: translate(-50%, -50%) rotate(90deg);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  animation: rise-in 420ms ease both;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 0;
  padding: 6px 10px;
  border-radius: 8px;
  color: #ffffff;
  background: rgba(18, 24, 38, 0.92);
  box-shadow: 0 10px 24px rgba(18, 24, 38, 0.16);
  font-size: 13px;
  font-weight: 860;
  line-height: 1;
  text-transform: uppercase;
}

.brand-mark strong {
  color: #ff3b3b;
  font-weight: 900;
}

.brand-block {
  display: grid;
  justify-items: center;
  gap: 4px;
  flex: 0 0 auto;
}

.brand-block small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 680;
  line-height: 1;
}

.page-heading {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.page-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  border-radius: 8px;
  color: var(--accent-strong);
  background: rgba(18, 167, 200, 0.10);
}

.page-icon svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

h1 {
  margin: 0;
  font-size: 24px;
  line-height: 1.08;
  font-weight: 820;
}

.tab,
.primary {
  border: 0;
  font: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.primary:active,
.tab:active {
  transform: translateY(1px) scale(0.99);
}

.notice,
.profile,
.screen {
  margin-top: 6px;
  animation: rise-in 460ms ease both;
}

.notice {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--soft-shadow);
  padding: 14px;
  color: var(--muted);
  line-height: 1.45;
}

.profile {
  display: block;
  border: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
}

.balance {
  position: relative;
  display: grid;
  gap: 3px;
  overflow: hidden;
  padding: 18px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(18, 167, 200, 0.16), rgba(25, 169, 116, 0.10)),
    var(--surface-strong);
}

.balance::after {
  content: "";
  position: absolute;
  top: 0;
  left: -45%;
  width: 42%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.72), transparent);
  transform: skewX(-18deg);
  animation: scan 4.8s ease-in-out infinite;
}

.balance span,
.facts span,
.code-box span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.balance strong {
  position: relative;
  z-index: 1;
  color: var(--text);
  font-size: 44px;
  line-height: 1;
  font-weight: 860;
}

.balance small {
  position: relative;
  z-index: 1;
  color: var(--muted);
}

.facts {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.facts div,
.code-box,
.item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  padding: 10px;
}

.facts div {
  border: 0;
  background: transparent;
  padding: 0;
}

.facts strong {
  display: block;
  margin-top: 2px;
  color: var(--text);
  overflow-wrap: anywhere;
}

#expended {
  color: var(--text);
}

.expended-value {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.expended-value #expended {
  font-size: 16px;
  font-weight: 820;
  line-height: 1;
}

.expended-value small {
  color: var(--text);
  font-size: 12px;
  font-weight: 720;
}

.identity-row {
  display: grid;
  grid-template-columns: 28px 1fr;
  align-items: center;
  gap: 9px;
}

.compact-stat {
  grid-template-columns: 28px 1fr;
}

.primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin-top: 12px;
  padding: 13px 14px;
  border-radius: 8px;
  color: var(--button-text);
  background: linear-gradient(135deg, var(--accent), var(--green));
  box-shadow: 0 14px 26px rgba(18, 167, 200, 0.22);
  font-weight: 800;
  transition: transform 160ms ease, filter 160ms ease, box-shadow 160ms ease;
}

.primary svg,
.screen-icon svg,
.fact-icon svg,
.item-icon svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.primary svg {
  width: 20px;
  height: 20px;
}

.primary:hover {
  filter: brightness(1.02);
  box-shadow: 0 16px 32px rgba(18, 167, 200, 0.28);
}

.primary:disabled {
  cursor: wait;
  opacity: 0.72;
}

.code-box {
  margin-top: 12px;
  text-align: center;
  border-color: var(--line-strong);
  animation: pop-in 260ms ease both;
}

.code-box strong {
  display: block;
  margin: 5px 0;
  color: var(--accent-strong);
  font-size: 34px;
  font-weight: 880;
  letter-spacing: 3px;
}

.screen {
  display: none;
}

.active-screen {
  display: grid;
  gap: 10px;
}

.screen-list {
  display: grid;
  gap: 8px;
}

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 12px;
  z-index: 10;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  width: min(620px, calc(100% - 24px));
  min-height: 70px;
  padding: 8px;
  transform: translateX(-50%);
  border: 1px solid var(--line);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.90);
  box-shadow: 0 18px 44px rgba(26, 42, 68, 0.14);
  backdrop-filter: blur(18px);
}

.nav-item {
  display: grid;
  place-items: center;
  gap: 2px;
  min-width: 0;
  min-height: 54px;
  border: 0;
  border-radius: 22px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 10.5px;
  font-weight: 760;
  cursor: pointer;
  outline: none;
  -webkit-tap-highlight-color: transparent;
  appearance: none;
  transition: color 160ms ease, background 160ms ease, transform 160ms ease;
}

.nav-item:focus,
.nav-item:focus-visible {
  outline: none;
}

.nav-icon {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
}

.nav-icon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-item.active {
  color: var(--accent-strong);
  background: rgba(18, 167, 200, 0.12);
  box-shadow: inset 0 0 0 1px rgba(18, 167, 200, 0.12);
}

.nav-item:active {
  transform: translateY(1px) scale(0.99);
}

.item {
  position: relative;
  display: grid;
  grid-template-columns: 28px 1fr;
  align-items: center;
  gap: 9px;
  overflow: hidden;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.item::before {
  content: none;
}

.item:hover {
  transform: translateY(-1px);
  border-color: var(--line-strong);
  box-shadow: var(--soft-shadow);
}

.item strong,
.item a {
  display: block;
  color: var(--text);
  text-decoration: none;
  overflow-wrap: anywhere;
  line-height: 1.2;
}

.item > div > span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  line-height: 1.3;
  font-size: 13px;
}

.item-icon,
.fact-icon {
  display: grid;
  place-items: center;
  color: var(--accent-strong);
}

.item-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(18, 167, 200, 0.09);
  margin: 0;
  align-self: center;
  flex: 0 0 auto;
}

.item-icon svg {
  width: 17px;
  height: 17px;
}

.faq-list {
  display: grid;
  gap: 8px;
}

.faq-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  overflow: hidden;
}

.faq-question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-weight: 760;
  text-align: left;
  padding: 10px;
  cursor: pointer;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

.faq-question svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  color: var(--accent-strong);
  transition: transform 180ms ease;
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
  padding: 0 10px;
  transition: max-height 220ms ease, padding 220ms ease;
}

.faq-item.open .faq-answer {
  max-height: 180px;
  padding: 0 10px 10px;
}

.faq-item.open .faq-question svg {
  transform: rotate(180deg);
}

.fact-icon {
  width: 24px;
  height: 24px;
  margin-bottom: 0;
}

.fact-icon svg {
  width: 19px;
  height: 19px;
}

.hidden {
  display: none !important;
}

.telegram-only {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  text-align: center;
}

.telegram-only > div {
  width: min(420px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 22px;
}

.telegram-only p:last-child {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pop-in {
  from {
    opacity: 0;
    transform: scale(0.98);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes scan {
  0%,
  42% {
    transform: translateX(0) skewX(-18deg);
  }
  72%,
  100% {
    transform: translateX(360%) skewX(-18deg);
  }
}

@keyframes particle-float {
  from {
    transform: translate3d(0, 0, 0) rotate(0deg);
  }
  to {
    transform: translate3d(var(--x), var(--y), 0) rotate(180deg);
  }
}

@media (max-width: 360px) {
  .shell {
    padding-inline: 10px;
  }

  h1 {
    font-size: 25px;
  }

  .balance strong {
    font-size: 38px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
