.boot-screen,
.error-screen {
  position: relative;
  display: grid;
  min-height: var(--tg-viewport-height);
  overflow: hidden;
  padding: 32px 22px calc(32px + var(--safe-bottom));
  place-content: center;
  justify-items: center;
  background: linear-gradient(180deg, #081636 0%, #184295 100%);
  text-align: center;
}

.boot-mark {
  position: relative;
  z-index: 2;
  display: grid;
  width: min(64vw, 290px);
  aspect-ratio: 1;
  margin-bottom: 18px;
  place-items: center;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.boot-lion {
  width: 82%;
  user-select: none;
  -webkit-user-drag: none;
}

.boot-title,
.error-title,
.page-title {
  margin: 0;
  letter-spacing: -.035em;
}

.boot-title {
  position: relative;
  z-index: 2;
  color: #fff;
  font-size: clamp(2rem, 8vw, 3rem);
}

.boot-message,
.error-message,
.page-subtitle,
.section-subtitle {
  color: var(--color-muted);
  line-height: 1.55;
}

.boot-message {
  position: relative;
  z-index: 2;
  max-width: 30rem;
}

.boot-progress-track,
.progress-track {
  overflow: hidden;
  border-radius: 999px;
  background: rgb(255 255 255 / 12%);
}

.boot-progress-track {
  position: relative;
  z-index: 2;
  width: min(72vw, 280px);
  height: 6px;
  margin-top: 15px;
}

.progress-indeterminate {
  width: 42%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #7af6d8, #897aff);
  animation: progress-slide 1.1s ease-in-out infinite alternate;
}

@keyframes progress-slide {
  from { transform: translateX(-15%); }
  to { transform: translateX(155%); }
}

.money-rain {
  position: absolute;
  z-index: 1;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.money-note {
  --column: calc((var(--note-index) * 37) % 100);
  position: absolute;
  top: -46px;
  left: calc(var(--column) * 1%);
  display: grid;
  width: 31px;
  height: 18px;
  place-items: center;
  border: 1px solid rgb(255 255 255 / 34%);
  border-radius: 3px;
  background: linear-gradient(145deg, #4ade80, #15803d);
  color: rgb(255 255 255 / 92%);
  font-size: .72rem;
  font-weight: 900;
  opacity: .78;
  transform: rotate(calc((var(--note-index) - 8) * 5deg));
  animation: money-fall calc(4.3s + (var(--note-index) % 5) * .55s) linear infinite;
  animation-delay: calc(var(--note-index) * -.39s);
}

@keyframes money-fall {
  from { translate: 0 -40px; rotate: 0deg; }
  to { translate: 34px calc(var(--tg-viewport-height) + 90px); rotate: 360deg; }
}

.error-icon {
  display: grid;
  width: 64px;
  height: 64px;
  margin-bottom: 18px;
  place-items: center;
  border-radius: 50%;
  background: rgb(251 113 133 / 16%);
  color: var(--color-danger);
  font-size: 2rem;
  font-weight: 900;
}

.error-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 16px;
}

.button,
.primary-action-button {
  min-height: 46px;
  padding: 11px 18px;
  border: 1px solid transparent;
  border-radius: 14px;
  font-weight: 800;
  cursor: pointer;
}

.button-primary,
.primary-action-button {
  background: linear-gradient(135deg, #28c76f, #16a34a);
  color: #052e16;
  box-shadow: 0 9px 20px rgb(34 197 94 / 24%);
}

.button-secondary {
  border-color: var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
}

.primary-action-button {
  display: flex;
  gap: 9px;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-top: 14px;
}

.primary-action-button:disabled {
  background: rgb(255 255 255 / 8%);
  color: var(--color-muted);
  box-shadow: none;
}

.request-id {
  margin-top: 22px;
  color: var(--color-muted);
  font-size: .72rem;
  word-break: break-all;
}

.page {
  animation: page-enter 190ms ease-out;
}

@keyframes page-enter {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: translateY(0); }
}

.page-header {
  display: grid;
  grid-template-columns: 42px 46px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  margin-bottom: 22px;
}

.page-back-button {
  display: grid;
  width: 42px;
  height: 42px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--color-border);
  border-radius: 13px;
  background: rgb(255 255 255 / 6%);
  color: #dce7fb;
  cursor: pointer;
  font-size: 1.28rem;
}

.page-heading-icon {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border: 1px solid var(--color-border);
  border-radius: 15px;
  background: rgb(255 255 255 / 7%);
  color: #4acfff;
  font-size: 1.45rem;
}

.page-heading-copy {
  min-width: 0;
}

.page-title {
  font-size: clamp(1.45rem, 6vw, 2rem);
}

.page-subtitle {
  margin: 4px 0 0;
  font-size: .82rem;
}

.section-heading {
  margin: 24px 0 12px;
}

.section-title {
  margin: 0;
  font-size: 1.05rem;
  letter-spacing: -.015em;
}

.section-subtitle {
  margin: 5px 0 0;
  font-size: .78rem;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px;
}

.metric-card {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 10px;
  min-height: 112px;
  align-items: start;
  padding: 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: linear-gradient(145deg, rgb(255 255 255 / 9%), rgb(255 255 255 / 4%));
  box-shadow: var(--shadow-card);
}

.metric-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 12px;
  background: rgb(255 255 255 / 8%);
  color: #a8c7ff;
  font-size: 1.25rem;
}

.metric-copy {
  display: grid;
  min-width: 0;
  gap: 5px;
}

.metric-label,
.metric-hint {
  color: var(--color-muted);
  font-size: .7rem;
}

.metric-value {
  overflow-wrap: anywhere;
  font-size: clamp(.98rem, 4.2vw, 1.24rem);
  line-height: 1.15;
}

.metric-card-success .metric-icon { color: #4ade80; background: rgb(74 222 128 / 12%); }
.metric-card-accent .metric-icon { color: #4acfff; background: rgb(74 207 255 / 12%); }
.metric-card-coin .metric-icon { color: #ffbd24; background: rgb(255 189 36 / 12%); }

.action-card {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) 22px;
  gap: 12px;
  align-items: center;
  width: 100%;
  min-height: 92px;
  padding: 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: linear-gradient(145deg, rgb(255 255 255 / 9%), rgb(255 255 255 / 4%));
  box-shadow: var(--shadow-card);
  text-align: left;
  cursor: pointer;
}

.action-card:active:not(:disabled) {
  transform: scale(.985);
}

.action-card:disabled {
  opacity: .82;
}

.action-icon {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 15px;
  background: rgb(255 255 255 / 9%);
  color: #9cbcf7;
  font-size: 1.42rem;
}

.action-copy {
  display: grid;
  min-width: 0;
  gap: 5px;
}

.action-title {
  font-size: .96rem;
}

.action-description {
  color: var(--color-muted);
  font-size: .76rem;
  line-height: 1.38;
}

.action-badge {
  width: fit-content;
  padding: 4px 7px;
  border-radius: 999px;
  background: rgb(255 255 255 / 8%);
  color: #d9e5f7;
  font-size: .63rem;
}

.action-chevron {
  color: #8090ad;
  font-size: 1.15rem;
}

.action-card:disabled .action-chevron {
  opacity: .25;
}

.action-card-earn .action-icon { color: #28c76f; background: rgb(40 199 111 / 12%); }
.action-card-play .action-icon { color: #ff4fe1; background: rgb(255 79 225 / 12%); }
.action-card-daily .action-icon { color: #4acfff; background: rgb(74 207 255 / 12%); }
.action-card-wheel .action-icon { color: #ffbd24; background: rgb(255 189 36 / 12%); }
.action-card-wallet .action-icon { color: #ef5b5b; background: rgb(239 91 91 / 12%); }
.action-card-withdraw .action-icon { color: #ffbd24; background: rgb(255 189 36 / 12%); }
.action-card-settings .action-icon { color: #a0a6b1; }
.action-card-account .action-icon { color: #4acfff; }

.feature-card-grid,
.settings-list,
.home-actions {
  display: grid;
  gap: 11px;
}

.status-pill {
  display: inline-flex;
  width: fit-content;
  padding: 4px 8px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: rgb(255 255 255 / 6%);
  color: #d7e3f6;
  font-size: .64rem;
  font-weight: 750;
}

.status-pill-success { border-color: rgb(74 222 128 / 40%); background: rgb(74 222 128 / 11%); color: #86efac; }
.status-pill-warning { border-color: rgb(251 191 36 / 40%); background: rgb(251 191 36 / 11%); color: #fde68a; }
.status-pill-provider { color: #b7d7ff; }

.info-banner {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 11px;
  margin: 12px 0;
  padding: 14px;
  border: 1px solid rgb(74 207 255 / 24%);
  border-radius: var(--radius-md);
  background: rgb(74 207 255 / 7%);
}

.info-banner-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 12px;
  background: rgb(74 207 255 / 11%);
  color: #4acfff;
  font-size: 1.2rem;
}

.info-banner-copy { min-width: 0; }
.info-banner-title { display: block; font-size: .88rem; }
.info-banner-message { margin: 4px 0 0; color: var(--color-muted); font-size: .75rem; line-height: 1.48; }
.info-banner-warning { border-color: rgb(251 191 36 / 30%); background: rgb(251 191 36 / 7%); }
.info-banner-warning .info-banner-icon { color: #fbbf24; background: rgb(251 191 36 / 11%); }
.info-banner-success { border-color: rgb(74 222 128 / 30%); background: rgb(74 222 128 / 7%); }
.info-banner-success .info-banner-icon { color: #4ade80; background: rgb(74 222 128 / 11%); }
.info-banner-locked { border-color: rgb(168 85 247 / 30%); background: rgb(168 85 247 / 7%); }
.info-banner-locked .info-banner-icon { color: #c084fc; background: rgb(168 85 247 / 11%); }

.definition-list {
  display: grid;
  gap: 1px;
  overflow: hidden;
  margin: 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-border);
}

.definition-row {
  display: grid;
  grid-template-columns: minmax(95px, .7fr) minmax(0, 1.3fr);
  gap: 12px;
  padding: 12px 14px;
  background: #0d234d;
}

.definition-row dt { color: var(--color-muted); font-size: .73rem; }
.definition-row dd { min-width: 0; margin: 0; overflow-wrap: anywhere; text-align: right; font-size: .78rem; }

@media (max-width: 360px) {
  .metrics-grid { grid-template-columns: 1fr; }
  .page-header { grid-template-columns: 40px 1fr; }
  .page-heading-icon { display: none; }
  .definition-row { grid-template-columns: 1fr; gap: 4px; }
  .definition-row dd { text-align: left; }
}
