:root {
  --bg: #0d1111;
  --panel: #232323;
  --panel-2: #1b1c1d;
  --text: #f5f5f5;
  --muted: #8d8f92;
  --accent: #ffffff;
  --nav: rgba(34, 34, 34, 0.96);
  --shadow: 0 18px 45px rgba(0, 0, 0, 0.42);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

body {
  overflow: hidden;
}

button,
input,
textarea,
select {
  font: inherit;
}

.app-shell {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  padding: calc(18px + env(safe-area-inset-top, 0px)) 18px calc(96px + var(--safe-bottom));
  background:
    radial-gradient(circle at 18% 10%, rgba(255, 255, 255, 0.06), transparent 26%),
    linear-gradient(180deg, #0a0e0f 0%, #111313 56%, #0d1010 100%);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 60px;
}

.user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.avatar-wrap {
  position: relative;
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  border-radius: 50%;
  padding: 2px;
  background: conic-gradient(from 210deg, #f5d838, #f8a800, #31383b, #f5d838);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
}

.avatar,
.avatar-fallback {
  position: absolute;
  inset: 2px;
  width: calc(100% - 4px);
  height: calc(100% - 4px);
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #1a1d1f;
}

.avatar {
  display: none;
  background: #242424;
}

.avatar.loaded {
  display: block;
}

.avatar-fallback {
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #34393c, #151719);
  color: #ffffff;
  font-weight: 800;
  font-size: 19px;
  letter-spacing: 0.02em;
}

.balance-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 180px;
  padding: 8px 11px;
  border-radius: 999px;
  color: #f7f7f7;
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
}

.balance-icon {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
}

.balance-icon img {
  width: 18px;
  height: 18px;
  display: block;
}

.menu-button {
  display: grid;
  place-items: center;
  gap: 4px;
  width: 52px;
  height: 52px;
  padding: 14px 13px;
  border: 0;
  border-radius: 17px;
  background: rgba(34, 34, 34, 0.98);
  box-shadow: var(--shadow);
  cursor: pointer;
}

.menu-button span {
  display: block;
  width: 24px;
  height: 4px;
  border-radius: 20px;
  background: #ffffff;
}

.content-area {
  min-height: calc(100vh - 190px);
  min-height: calc(100dvh - 190px);
  padding-top: 52px;
}

.tab-page {
  display: none;
  min-height: 260px;
}

.tab-page.active {
  display: block;
}

.games-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 14px;
  width: 100%;
}

.game-card {
  all: unset;
  box-sizing: border-box;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 218px;
  padding: 62px 14px 18px;
  border-radius: 16px;
  background: linear-gradient(180deg, #262628 0%, #202022 100%);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.28);
  color: #ffffff;
  text-align: center;
  cursor: pointer;
  overflow: visible;
}

.game-icon-box {
  position: absolute;
  top: -24px;
  left: 50%;
  display: grid;
  place-items: center;
  width: 88px;
  height: 88px;
  border-radius: 22px;
  transform: translateX(-50%);
  box-shadow: 0 16px 26px rgba(0, 0, 0, 0.28);
  overflow: hidden;
}

.game-icon-blue {
  background: linear-gradient(180deg, #20d5ff 0%, #05aee6 100%);
}

.game-icon-box img {
  display: block;
  width: 78px;
  height: 78px;
  object-fit: contain;
  transform: translateY(4px);
}

.game-title {
  display: block;
  width: 100%;
  margin-top: 24px;
  font-size: 21px;
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.game-description {
  display: block;
  width: 100%;
  margin-top: 16px;
  padding: 0 4px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.35;
  color: #8d8f92;
}

.bottom-tabs {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: end;
  min-height: calc(86px + var(--safe-bottom));
  padding: 9px 18px calc(12px + var(--safe-bottom));
  background: var(--nav);
  border-top: 1px solid rgba(255, 255, 255, 0.035);
  box-shadow: 0 -18px 40px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(18px);
}

.tab-button {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  min-width: 0;
  height: 68px;
  padding: 0 4px;
  border: 0;
  background: transparent;
  color: #8d8d8d;
  cursor: pointer;
}

.tab-button::before {
  content: "";
  position: absolute;
  top: 1px;
  left: 50%;
  width: 28px;
  height: 3px;
  border-radius: 999px;
  background: transparent;
  transform: translateX(-50%);
}

.tab-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  opacity: 0.86;
  filter: grayscale(1);
}

.tab-icon img {
  width: 100%;
  height: 100%;
  display: block;
}

.profile-icon {
  width: 35px;
  height: 35px;
}

.tab-label {
  font-size: 15px;
  line-height: 1.05;
  color: currentColor;
  text-transform: lowercase;
}

.tab-button.active {
  color: #ffffff;
}

.tab-button.active::before {
  background: rgba(255, 255, 255, 0.95);
}

.tab-button.active .tab-label {
  font-weight: 850;
}

.tab-button.active .tab-icon {
  opacity: 1;
  filter: none drop-shadow(0 0 8px rgba(255, 255, 255, 0.08));
}

@media (max-width: 390px) {
  .games-grid {
    gap: 16px 12px;
  }

  .game-card {
    min-height: 204px;
    padding: 58px 12px 16px;
  }

  .game-icon-box {
    width: 80px;
    height: 80px;
    border-radius: 20px;
  }

  .game-icon-box img {
  display: block;
  width: 78px;
  height: 78px;
  object-fit: contain;
  transform: translateY(4px);
}

  .game-title {
    margin-top: 22px;
    font-size: 19px;
  }

  .game-description {
    margin-top: 14px;
    font-size: 13px;
  }
}

@media (min-width: 560px) {
  .app-shell {
    max-width: 480px;
    margin: 0 auto;
    border-left: 1px solid rgba(255, 255, 255, 0.05);
    border-right: 1px solid rgba(255, 255, 255, 0.05);
  }

  .bottom-tabs {
    left: 50%;
    right: auto;
    width: 480px;
    transform: translateX(-50%);
  }
}


.rocket-video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
  pointer-events: none;
}
