:root {
	--safe-top:env(safe-area-inset-top, 0px);
	--safe-bot:env(safe-area-inset-bottom, 0px);
}
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
}
body {
  background: #0e182e;
  color: #000;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(circle at 50% 50%,
      transparent 0,
      transparent 55%,
      rgba(0, 0, 0, 0.8) 100%);
  opacity: 0.9;
  animation: vignettePulse 6s ease-in-out infinite;
  will-change: opacity;
}

@keyframes vignettePulse {
  0%, 100% {
    opacity: 0.9; /* состояние как сейчас */
  }
  50% {
    opacity: 0.1; /* чуть слабее виньетка, но не исчезает */
  }
}


.app {
  position: relative;
  width: 100vw;
  height: var(--tg-viewport-height, 100dvh);
  padding-top: calc(
    var(--tg-safe-area-inset-top, 0px) +
    var(--tg-content-safe-area-inset-top, 0px)
  );
  padding-right:  var(--tg-safe-area-inset-right, 0px);
  padding-bottom: var(--tg-safe-area-inset-bottom, 0px);
  padding-left:   var(--tg-safe-area-inset-left, 0px);
  display: flex;
  flex-direction: column;
}
.contents {
  margin: 0 auto;
  width: 100%;
}
.content-item {
  padding: 0 14px;
  padding-bottom: calc(190px + var(--safe-bot));
}
.content-item[hidden] {
  display:none!important;
}
.container {
  margin: 0 auto;
  width: 100%;
  max-width: 480px;
}

/* Backgound space start */

.body-bg{
  position:fixed;
  width:100%;
  height:100%;
  top:0;
  left:0;
  line-height:0
}

.stars-wrapper {
  position: relative;
  pointer-events: none;
  width: 100vw;
  height: var(--tg-viewport-height, 100dvh);
  background: 0 0;
  overflow: hidden;
}

.stars {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  -webkit-animation: twinkle 4s ease-in-out infinite;
  animation: twinkle 4s ease-in-out infinite;
}

.stars:nth-child(2) {
  -webkit-animation-delay: -1.32s;
  animation-delay: -1.32s;
}

.stars:nth-child(3) {
  -webkit-animation-delay: -2.64s;
  animation-delay: -2.64s;
}

@-webkit-keyframes twinkle {
  25% {
    opacity: 0;
  }
}

@keyframes twinkle {
  25% {
    opacity: 0;
  }
}

.star {
  fill: #fff;
}

.star:nth-child(3n) {
  opacity: 0.8;
}

.star:nth-child(7n) {
  opacity: 0.6;
}

.star:nth-child(13n) {
  opacity: 0.4;
}

.star:nth-child(19n) {
  opacity: 0.2;
}

.comet {
  -webkit-transform-origin: center center;
  -ms-transform-origin: center center;
  transform-origin: center center;

  -webkit-animation: comet 10s linear infinite;
  animation: comet 10s linear infinite;
}

@-webkit-keyframes comet {
  0%,
  40% {
    -webkit-transform: translateX(0);
    transform: translateX(0);
    opacity: 0;
  }

  50% {
    opacity: 1;
  }

  60%,
  100% {
    -webkit-transform: translateX(-100vmax);
    transform: translateX(-100vmax);
    opacity: 0;
  }
}

@keyframes comet {
  0%,
  40% {
    -webkit-transform: translateX(0);
    transform: translateX(0);
    opacity: 0;
  }

  50% {
    opacity: 1;
  }

  60%,
  100% {
    -webkit-transform: translateX(-100vmax);
    transform: translateX(-100vmax);
    opacity: 0;
  }
}

.comet-b {
  -webkit-animation-delay: -3.3s;
  animation-delay: -3.3s;
}

.comet-c {
  -webkit-animation-delay: -5s;
  animation-delay: -5s;
}
/* Backgound space end */


/* Orbit and planets start */
.space-scene {
  position: relative;
  --planet-size: clamp(64px, 16%, 64px);
  width: min(100%, 100vmin, 460px);
  aspect-ratio: 1 / 1;
  max-height: 100vmin;
  margin: 0 auto;
  overflow: hidden;
  touch-action: manipulation;
}
.orbit {
  position: absolute;
  top: 50%;
  left: 50%;
  border-radius: 50%;
  border: 1.2px dashed rgba(255,255,255,0.36);
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.orbit--small {
  width: 40%;
  height: 40%;
  z-index: 1;
}
.orbit--medium {
  width: 60%;
  height: 60%;
  border-color: rgba(255,255,255,0.3);
  z-index: 2;
}
.orbit--large {
  width: 80%;
  height: 80%;
  border-color: rgba(255,255,255,0.24);
  z-index: 3;
}
.orbit-slot {
  --angle: 0deg;
  position: absolute;
  inset: 0;
  pointer-events: none;
  transform: rotate(var(--angle));
  transform-origin: 50% 50%;
}
.planet {
  position: absolute;
  left: 50%;
  top: calc(-0.5 * var(--planet-size)); /* или просто top:-6vmin; как у тебя */
  transform: translateX(-50%) rotate(calc(-1 * var(--angle)));
  transform-origin: center center;
  border: none;
  padding: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  pointer-events: auto;
  -webkit-tap-highlight-color: transparent;
  outline: none;
  width: var(--planet-size);  /* или твои размеры */
  height: var(--planet-size);
}
.planet:not(.add-planet) {
	opacity: 0;
}
.planet.active {
	opacity: 1;
}
.planet1 {
	animation: 25s linear 0s infinite normal none running rot;
}
.planet2 {
	animation: 35s linear 0s infinite normal none running rot;
}
.planet3 {
	animation: 45s linear 0s infinite normal none running rot;
}
.planet4 {
	animation: 25s linear 0s infinite normal none running rot;
}
.planet5 {
	animation: 45s linear 0s infinite normal none running rot;
}
.planet6 {
	animation: 55s linear 0s infinite normal none running rot;
}
.planet__img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  border-radius: 50%;
  transition: transform 0.15s ease-out, box-shadow 0.15s ease-out;
}
.planet:active .planet__img,
.planet:focus-visible .planet__img {
  transform: scale(1.08);
  box-shadow:
    0 0 16px rgba(255,255,255,0.9),
    0 0 28px rgba(0,200,255,0.9);
}
.planet__level {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 24px;
  height: 24px;
  border-radius: 24px;
  background: #0e182e;
  color: #0e182e;
  font-size: 9px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}
.planet__level span {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 19px;
  height: 19px;
  border-radius: 20px;
  background: #fff;
}
@media (max-width: 360px) {
  .space-scene {
    --planet-size: clamp(34px, 15%, 56px);
  }
}
.add-planet {
    position: relative;
    border: 1.2px dashed rgba(255, 255, 255, .35);
    color: #fff;
    border-radius: 50%;
    width: var(--planet-size);
    height: var(--planet-size);
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
    background: #0e182e;
}
.add-planet::before {
    content: "";
    display: block;
    width: calc(var(--planet-size) - 20%);
    height: calc(var(--planet-size) - 20%);
    border: 1.2px dashed rgba(255, 255, 255, .24);
    border-radius: 50%;
    position: absolute;
    z-index: 1;
}
.add-planet .desc {
    position: absolute;
    z-index: 3;
    width: 147px;
    background: #283753;
    border-radius: 8px;
    font-weight: 400;
    font-size: 10px;
    line-height: 20px;
    color: #fff;
    padding: 9px;
    top: -70px;
    right: -10%;
}
.add-planet .desc:after {
    top: 99%;
	right: 30px;
	border: solid transparent;
	content: "";
	height: 0;
	width: 0;
	position: absolute;
	pointer-events: none;
	border-color: rgba(40, 55, 83, 0);
	border-top-color: #283753;
	border-width: 8px;
	margin-left: -8px;
	z-index: 99;
}
/* Orbit and planets end */


/* User data start */
.user-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
}
.user-action {
	display: flex;
	align-items: center;
	gap: 8px;
	width: 90px;
	justify-content: flex-end;
}
.user-action button {
	display: flex;
    align-items: center;
    justify-content: center;
	background: rgba(40, 55, 83, .35);
    color: #fff;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 0 0 0.5px rgba(255, 255, 255, 0.06);
    border-radius: 999px;
    border: none;
    outline: none;
    cursor: pointer;
    width: 30px;
    height: 30px;
}
.user-data {
	display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 6px 14px;
    min-height: 30px;
    border: none;
    border-radius: 999px;
    @background: var(--tg-theme-secondary-bg-color, rgba(0, 0, 0, 0.35));
    background: rgba(40, 55, 83, .35);
    color: #fff;
    font: 500 14px/1.2 system-ui, -apple-system, BlinkMacSystemFont,
          "SF Pro Text", "Segoe UI", sans-serif;
    cursor: pointer;
    outline: none;
    white-space: nowrap;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 0 0 0.5px rgba(255, 255, 255, 0.06);
}
.user-data_avatar {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 24px;
	height: 24px;
	border-radius: 30px;
	overflow: hidden;
}
.user-data_avatar img {
	width: 100%;
    height: 100%;
    object-fit: cover;
}
.user-data_names {
	width: fit-content;
	max-width: 160px;
	overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

/* User data end */


/* modal start */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #0e182e;/* затемнение */
  display: none; /* скрыто по умолчанию */
  justify-content: center;
  align-items: center;
  z-index: 9999;
  transition: opacity 0.3s ease;
}
.modal.active {
  display: flex;
  opacity: 1;
}
.modal-content {
  background: linear-gradient(183.73deg, #0f192f 4.51%, #1c2539 96.91%);
  color: #fff;
  width: 100%;
  height: var(--tg-viewport-height, 100dvh);
  max-width: 460px;
  padding-left: 20px;
  padding-right: 20px;
  position: relative;
  animation: slideDown 0.3s ease;
  padding-top: calc(
  	64px +
    var(--tg-safe-area-inset-top, 0px) +
    var(--tg-content-safe-area-inset-top, 0px)
  );
  padding-bottom: var(--tg-safe-area-inset-bottom, 20px);
  overflow: auto;
}
.modal-content .modal-close {
  position: absolute;
  top: calc(
  	14px +
    var(--tg-safe-area-inset-top, 0px) +
    var(--tg-content-safe-area-inset-top, 0px)
  );
  right: 20px;
  background: 0 0;
  width: 36px;
  height: 36px;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  -webkit-box-pack: center;
  -ms-flex-pack: center;
  justify-content: center;
  z-index: 2;
  background: transparent;
  border: none;
  outline: none;
  border: 1px dashed rgba(255, 255, 255, .1);
  border-radius: 50%;
}
.modal-content .modal-close::before {
    content: "";
    display: block;
    width: 50px;
    height: 50px;
    border: 1px dashed rgba(255, 255, 255, .065);
    border-radius: 50%;
    position: absolute;
}
.modal-action {
    position: fixed;
    left: 0;
    right: 0;
	  bottom: 0;
    padding-bottom: calc(16px + var(--tg-safe-area-inset-top, 20px));
    padding-top: 20px;
    width: 100%;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.modal-action button {
	width: calc(100% - 0px);
}
.modal-content .modal-header_title {
  font-size: 18px;
  font-weight: bold;
  text-align: center;
}
@keyframes slideDown {
  from {
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}
/* modal end */


/* button start */
.btn{ 
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 50px;
    font-size: 16px;
    height: 50px;
    min-width: 50px;
    padding: 0 16px;
    text-align: center;
    transition: .25s ease-in-out;
    border: none;
    outline: none;
}
:root {
  --bg-main: #0e182e;

  --btn-primary: #5b8cff;
  --btn-secondary: #7b5cff;
  --btn-accent: #ff7ee5;
  --btn-special: #ffd56b;

  --btn-text-dark: #0b1020;
  --btn-text-light: #f9fafb;
}

.btn {
  border-radius: 999px;
  padding: 10px 22px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

/* Основная */
.btn-primary {
  background: var(--btn-primary);
  color: var(--btn-text-light);
  box-shadow: 0 0 16px rgba(91, 140, 255, 0.6);
}
.btn-primary:hover {
  transform: translateY(-1px);
  background: #4976f5;
}

/* Вторичная */
.btn-secondary {
  background: var(--btn-secondary);
  color: var(--btn-text-light);
  box-shadow: 0 0 16px rgba(123, 92, 255, 0.6);
}

/* Неоновый акцент */
.btn-accent {
  background: var(--btn-accent);
  color: var(--btn-text-dark);
  box-shadow: 0 0 18px rgba(255, 126, 229, 0.7);
}

/* Особая / звёздная */
.btn-special {
  background: var(--btn-special);
  color: var(--btn-text-dark);
  box-shadow: 0 0 18px rgba(255, 213, 107, 0.7);
}


.btn svg{ width:20px; height:20px; stroke:currentColor; fill:none; stroke-width:2; }
.btn-full {
  width: 100%;
}

/* button end */


.nav {
  position: fixed;
  padding: 0 10px;
  left: 0;
  right: 0;
  bottom: 0;
  @height: calc(64px + var(--tg-safe-area-inset-bottom, 0px));
  min-height: 144px;
  z-index: 9;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0 auto;
  max-width: 460px;
}

.balance {
	position: relative;
  background: linear-gradient(189.19deg, #0f192f 12.18%, #1c2539 96.9%);
  border-radius: 50% 50% 10px 10px;
  padding: 14px 0;
  position: relative;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
  -ms-flex-direction: column;
  flex-direction: column;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
}
.balance .icon {
  position: absolute;
  top: -30px;
  z-index: 1;
}
.balance .values {
	text-align: center;
    padding: 0 28px 6px;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -ms-flex-direction: column;
    flex-direction: column;
    -webkit-box-pack: end;
    -ms-flex-pack: end;
    justify-content: flex-end;
}
.balance .values p {
	font-weight: 400;
    font-size: 14px;
    line-height: 185%;
    color: #82aad0;
    opacity: .5;
}
.balance .values h3 {
	font-weight: 700;
    font-size: 35px;
    line-height: 100%;
    background: -o-linear-gradient(175.39deg,#4d535f 16.26%,#ebeded 116.73%);
    background: linear-gradient(274.61deg, #4d535f 16.26%, #ebeded 116.73%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-fill-color: transparent;
}

.nav-list {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  align-items: center;
  margin: 0 auto;
  width: 100%;
  max-width: 480px;
  @height: calc(64px + var(--tg-safe-area-inset-bottom, 0px));
  height: 64px;
  margin-bottom: var(--tg-safe-area-inset-bottom, 10px);
  background: linear-gradient(193.69deg, #0f192f 16.69%, #1c2539 89.75%);
  border-radius: 10px;
}
.nav button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 64px;
  @margin-bottom: var(--safe-bot);
  text-decoration: none;
  @color: var(--muted);
  color: #fff;
  font-size: 11px;
  background: transparent;
  border: none;
  outline: none;
}
.nav button.deposit-btn {
  margin-left: auto;
  margin-right: auto;
  width: 40px;
  height: 40px;
  background: #08a652;
  border-radius: 64px;
  color: #fff;
  box-shadow: 0 0 0 6px rgba(0, 0, 0, 0.04);
  border: 6px solid rgba(255, 255, 255, .5);
}
.nav button.deposit-btn svg {
  min-width: 16px;
}
.nav button.active_nav_link {
  color: var(--accent);
}
