.profile-screen {
  position: relative;
  z-index: 1;
  width: 100%;
}

.profile-stars {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.profile-hero {
  width: min(100%, 420px);
  margin: 0 auto 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-radius: 20px;
  background: #ffffff12;
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}

.profile-hero__avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  background: #ffffff22;
  flex-shrink: 0;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.15);
}

.profile-hero__info {
  flex: 1;
  min-width: 0;
}

.profile-hero__name {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-hero__nick {
  margin: 4px 0 0;
  font-size: 13px;
  font-weight: 600;
  color: #ffffff80;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-balance {
  height: 36px !important;
  padding: 0 12px !important;
  border-radius: 18px !important;
  flex-shrink: 0;
}

.profile-balance p {
  font-size: 14px !important;
}

.profile-promo-open {
  appearance: none;
  border: none;
  flex-shrink: 0;
  width: 100px;
  height: 36px;
  padding: 0 8px;
  border-radius: 18px;
  background: #ffffff1a;
  color: #ffffffe6;
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.15;
  cursor: pointer;
  white-space: normal;
  text-align: center;
}

.profile-promo-open:active {
  opacity: 0.8;
  transform: scale(0.98);
}

.profile-promo__row {
  display: flex;
  gap: 8px;
}

.profile-promo__input {
  flex: 1;
  min-width: 0;
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  background: #00000033;
  color: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 11px 12px;
  outline: none;
}

.profile-promo__input::placeholder {
  color: #ffffff4d;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}

.profile-promo__input:focus {
  border-color: rgba(115, 255, 157, 0.45);
}

.profile-promo__btn {
  appearance: none;
  border: none;
  border-radius: 12px;
  padding: 0 16px;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  color: #0c0d0e;
  background: #73ff9d;
  flex-shrink: 0;
}

.profile-promo__btn:disabled {
  opacity: 0.45;
  cursor: default;
}

.profile-promo__btn:active:not(:disabled) {
  opacity: 0.85;
  transform: scale(0.98);
}

.profile-invite {
  width: min(100%, 420px);
  margin: 0 auto 16px;
  padding: 16px;
  border-radius: 20px;
  background: #ffffff12;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.profile-invite__title {
  margin: 0 0 14px;
  font-size: 17px;
  font-weight: 800;
  line-height: 1.3;
  color: #fff;
}

.profile-invite__badge {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 8px;
  background: #e12d39;
  color: #fff;
  font-weight: 800;
}

.profile-invite__stats {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}

.profile-invite__stat {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 14px 8px;
  border-radius: 14px;
  background: #ffffff0d;
}

.profile-invite__stat-value {
  font-size: 22px;
  font-weight: 800;
  color: #fff;
}

.profile-invite__stat-label {
  font-size: 12px;
  font-weight: 600;
  color: #ffffff80;
}

.profile-invite__actions {
  display: flex;
  gap: 10px;
}

.profile-invite__btn {
  flex: 1;
  appearance: none;
  border: none;
  border-radius: 14px;
  padding: 14px 16px;
  font: inherit;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  color: #fff;
  background: #e12d39;
}

.profile-invite__btn:active {
  opacity: 0.88;
  transform: scale(0.99);
}

.profile-invite__copy {
  appearance: none;
  border: none;
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: #ffffff14;
  color: #ffffffcc;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.profile-invite__copy:active {
  opacity: 0.85;
  transform: scale(0.97);
}

.promo-modal {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.promo-modal[hidden] {
  display: none !important;
}

.promo-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}

.promo-modal__sheet {
  position: relative;
  width: min(100%, 380px);
  margin: 0 auto;
  padding: 18px 16px 20px;
  border-radius: 20px;
  background: #17181c;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}

.promo-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.promo-modal__title {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
  color: #fff;
}

.promo-modal__close {
  appearance: none;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #ffffff14;
  color: #ffffffcc;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.profile-tabs {
  width: min(100%, 420px);
  margin: 0 auto 16px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 4px;
  border-radius: 14px;
  background: #00000033;
  border: 1px solid #ffffff12;
}

.profile-tab {
  appearance: none;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #ffffff88;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  padding: 10px 8px;
  cursor: pointer;
}

.profile-tab.is-active {
  background: #ffffff18;
  color: #fff;
  box-shadow: inset 0 0 0 1px #ffffff14;
}

.profile-tab:active:not(.is-active) {
  opacity: 0.8;
}

.profile-section {
  width: min(100%, 420px);
  margin: 0 auto;
}

.profile-section__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.profile-section__title {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
}

.profile-section__count {
  min-width: 28px;
  height: 28px;
  padding: 0 8px;
  border-radius: 999px;
  background: #ffffff18;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: #ffffffcc;
}

.profile-ledger {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.profile-ledger__item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 14px;
  background: #ffffff12;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.profile-ledger__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.profile-ledger__title {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-ledger__time {
  font-size: 11px;
  font-weight: 600;
  color: #ffffff66;
}

.profile-ledger__delta {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
}

.profile-ledger__item.is-credit .profile-ledger__delta {
  color: #73ff9d;
}

.profile-ledger__item.is-debit .profile-ledger__delta {
  color: #ff8e8e;
}

.profile-ledger__star {
  width: 13px;
  height: 13px;
  object-fit: contain;
  display: block;
}

.profile-ledger__loading {
  text-align: center;
  padding: 24px 12px;
  font-size: 13px;
  font-weight: 600;
  color: #ffffff80;
}

.profile-inv {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  align-items: stretch;
}

.profile-inv__card {
  background: #ffffff12;
  border-radius: 14px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  height: 100%;
  min-height: 0;
  overflow: hidden;
  box-sizing: border-box;
}

.profile-inv__art {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 10px;
  background: #00000022;
  overflow: hidden;
  flex: 0 0 auto;
}

.profile-inv__art > * {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  margin: 0 !important;
}

.profile-inv__art canvas,
.profile-inv__art svg {
  display: block;
  object-fit: contain;
}

.profile-inv__img {
  object-fit: contain;
  display: block;
}

.profile-inv__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  height: 18px;
  flex: 0 0 18px;
  min-width: 0;
}

.profile-inv__name {
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.profile-inv__qty {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 800;
  color: #9ec1ff;
  background: #ffffff14;
  border-radius: 999px;
  padding: 2px 6px;
}

.profile-inv__actions {
  display: grid;
  grid-template-rows: 28px 28px;
  gap: 4px;
  margin-top: auto;
  flex: 0 0 auto;
}

.profile-inv__btn {
  appearance: none;
  border: none;
  border-radius: 8px;
  padding: 0 4px;
  height: 28px;
  min-height: 28px;
  max-height: 28px;
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  width: 100%;
  box-sizing: border-box;
}

.profile-inv__btn--out {
  background: #73ff9d;
  color: #0c0d0e;
}

.profile-inv__btn--sell {
  background: #ff3b3b;
}

.profile-inv__btn--ghost {
  visibility: hidden;
  pointer-events: none;
}

.profile-inv__btn:active:not(.profile-inv__btn--ghost) {
  opacity: 0.85;
  transform: scale(0.98);
}

.profile-inv__star {
  width: 11px;
  height: 11px;
  object-fit: contain;
  display: inline-block;
  flex-shrink: 0;
}

.profile-empty {
  text-align: center;
  padding: 36px 16px;
  border-radius: 18px;
  background: #ffffff0c;
}

.profile-empty p {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 700;
}

.profile-empty span {
  font-size: 13px;
  color: #ffffff80;
  font-weight: 500;
}

.screen-game.is-profile {
  background: #000;
  padding: 0;
}
