/* Design tokens */
:root {
  --bg: #08090c;
  --bg-gradient-top: #142042;
  --bg-elevated: rgba(255, 255, 255, 0.03);
  --bg-elevated-hover: rgba(255, 255, 255, 0.05);
  --border: rgba(255, 255, 255, 0.06);
  --border-strong: rgba(255, 255, 255, 0.12);
  --border-blue: rgba(74, 124, 255, 0.4);
  --border-gold: rgba(212, 175, 106, 0.4);
  --text: #f5f6f8;
  --text-muted: #8a92a8;
  --text-dim: #4f6080;
  --gold: #d4af6a;
  --gold-bright: #e8c47e;
  --gold-dim: rgba(212, 175, 106, 0.15);
  --blue: #4a7cff;
  --blue-bright: #6b94ff;
  --blue-dim: rgba(74, 124, 255, 0.15);
  --red: #ff5a5a;
  --red-bright: #ff7878;
  --orange: #ff9a3c;
  --orange-bright: #ffb05c;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 14px;
  --radius-xl: 18px;
  --tg-safe-area-inset-top: 0px;
  --tg-content-safe-area-inset-top: 0px;
  --app-safe-area-top: max(
    env(safe-area-inset-top, 0px),
    var(--tg-safe-area-inset-top, 0px),
    var(--tg-content-safe-area-inset-top, 0px)
  );
  --app-header-min-top-padding: 66px;
  --app-header-safe-top-offset: 26px;
  --app-header-top-padding: max(
    var(--app-header-min-top-padding),
    calc(var(--app-safe-area-top) + var(--app-header-safe-top-offset))
  );
  --app-header-bottom-padding: 8px;
  --app-header-logo-height: 36px;
  --app-logo-content-gap: 36px;
  --app-header-height: calc(
    var(--app-header-top-padding) + var(--app-header-logo-height) + var(--app-header-bottom-padding)
  );
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  background: var(--bg);
  color: var(--text);
  font-family: "Geist", sans-serif;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "ss01", "ss02";
}

body {
  min-height: 100vh;
  display: flex;
  justify-content: center;
}

.phone {
  width: 100%;
  max-width: 420px;
  min-height: 100vh;
  background: radial-gradient(ellipse at top, var(--bg-gradient-top) 0%, var(--bg) 60%);
  position: relative;
  overflow: hidden;
  padding-bottom: 80px;
}

.phone::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.3;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
  z-index: 1;
}

.content {
  position: relative;
  z-index: 2;
  padding: 0 22px 40px;
}

.logo-block {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  min-height: calc(var(--app-header-logo-height) + var(--app-header-bottom-padding));
  padding: 0 0 var(--app-header-bottom-padding);
  margin-bottom: -8px;
  position: relative;
  z-index: 2;
  animation: fadeUp 0.6s ease both;
}

.logo-text {
  font-weight: 800;
  font-size: 17px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  line-height: 1;
}

.logo-text .gold {
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-bright) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.logo-text .light {
  color: rgba(255, 255, 255, 0.85);
}

.logo-text--catalog {
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.0325rem;
  text-transform: none;
}

.topbar-spacer {
  height: var(--app-header-top-padding);
  margin-top: 0;
  position: relative;
  z-index: 2;
}

.balance {
  margin-top: var(--app-logo-content-gap);
  padding: 14px 18px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.045) 0%, rgba(255, 255, 255, 0.015) 50%, rgba(255, 255, 255, 0.003) 100%);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  border-bottom: 1px solid rgba(0, 0, 0, 0.25);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(20px);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.3), 0 1px 0 rgba(255, 255, 255, 0.05) inset;
  animation: fadeUp 0.8s ease both;
}

.balance-label {
  font-size: 9px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 8px;
}

.balance-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.balance-amount {
  font-weight: 400;
  font-size: 24px;
  letter-spacing: -0.04em;
  line-height: 1;
  font-feature-settings: "tnum";
}

.balance-amount .currency {
  color: var(--gold);
  font-weight: 400;
  margin-left: 8px;
}

.cabinet-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 16px;
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-bright) 100%);
  color: #0a0c12;
  border: none;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(212, 175, 106, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.3);
  transition: all 0.25s ease;
  flex-shrink: 0;
}

.cabinet-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(212, 175, 106, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.cabinet-btn:active {
  transform: translateY(0);
}

.cabinet-btn svg {
  width: 12px;
  height: 12px;
  stroke-width: 2.5;
}

.title-block {
  margin-top: 28px;
  margin-bottom: 26px;
  animation: fadeUp 0.8s 0.1s ease both;
  text-align: center;
}

.title {
  font-weight: 700;
  font-size: 22px;
  line-height: 1.2;
  letter-spacing: 0.01em;
  color: var(--text);
  text-transform: uppercase;
  padding: 0 10px;
}

.title span {
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-bright) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.title-divider {
  width: 70px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  margin: 14px auto 0;
  border-radius: 1px;
}

.subtitle {
  margin-top: 10px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-muted);
  font-weight: 400;
}

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto auto;
  gap: 10px;
}

.card {
  text-decoration: none;
  color: inherit;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.055) 0%, rgba(255, 255, 255, 0.018) 50%, rgba(255, 255, 255, 0.004) 100%);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  border-bottom: 1px solid rgba(0, 0, 0, 0.3);
  border-radius: var(--radius-lg);
  padding: 16px 14px 14px;
  cursor: pointer;
  position: relative;
  transition: all 0.35s ease;
  animation: fadeUp 0.7s ease both;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 1px 0 rgba(255, 255, 255, 0.07) inset;
}

.card:nth-child(1) {
  animation-delay: 0.15s;
}

.card:nth-child(2) {
  animation-delay: 0.22s;
}

.card:nth-child(3) {
  animation-delay: 0.29s;
}

.card:hover {
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.09) 0%, rgba(255, 255, 255, 0.03) 50%, rgba(255, 255, 255, 0.008) 100%);
  border-color: rgba(212, 175, 106, 0.4);
  transform: translateY(-3px);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(212, 175, 106, 0.12), 0 0 30px rgba(212, 175, 106, 0.06) inset, 0 1px 0 rgba(255, 255, 255, 0.12) inset;
}

.card:active {
  transform: translateY(0) scale(0.97);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.04) 0%, rgba(255, 255, 255, 0.015) 100%);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(212, 175, 106, 0.15), 0 1px 0 rgba(255, 255, 255, 0.06) inset;
}

.card.card-tall {
  grid-row: span 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 22px 18px;
}

.card.card-tall .flag {
  width: 60px;
  height: 43px;
  border-radius: 8px;
  margin-bottom: 14px;
}

.card.card-tall .flag img {
  width: calc(100% + 2px);
  height: calc(100% + 2px);
  margin: -1px;
}

.card.card-tall .card-name {
  font-size: 23px;
  margin-bottom: 6px;
}

.card .card-tag {
  position: absolute;
  top: 14px;
  right: 14px;
}

.card-flag-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.flag {
  width: 40px;
  height: 28px;
  border-radius: 6px;
  flex-shrink: 0;
  overflow: hidden;
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.flag-tr,
.flag-ua,
.flag-in,
.flag-steam {
  background: none;
  padding: 0;
}

.flag-tr img,
.flag-ua img,
.flag-in img {
  display: block;
  width: calc(100% + 2px);
  height: calc(100% + 2px);
  margin: -1px;
  object-fit: cover;
}

.flag-steam {
  border: none;
}

.flag-steam img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.card-tag {
  font-size: 7px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(212, 175, 106, 0.55);
  padding: 3px 7px;
  background: rgba(212, 175, 106, 0.06);
  border: 1px solid rgba(212, 175, 106, 0.1);
  border-radius: 5px;
  font-weight: 600;
  line-height: 1;
}

.card-name {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 6px;
}

.card-desc {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.45;
  font-weight: 400;
}

.card-desc.single-line {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.steam-section {
  margin-top: 28px;
  animation: fadeUp 0.7s 0.4s ease both;
}

.steam-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-dim);
  margin-bottom: 10px;
}

.steam-card {
  text-decoration: none;
  color: inherit;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.04) 0%, rgba(255, 255, 255, 0.012) 100%);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: all 0.3s;
  backdrop-filter: blur(20px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25), 0 1px 0 rgba(255, 255, 255, 0.05) inset;
  position: relative;
}

.steam-card:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(102, 192, 244, 0.3);
  transform: translateX(2px);
}

.steam-card:active {
  transform: translateX(0);
}

.steam-badge {
  position: absolute;
  top: -8px;
  right: 12px;
  padding: 3px 10px;
  border-radius: 6px;
  background: linear-gradient(135deg, #66c0f4, #4fa3d7);
  font-size: 9px;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  box-shadow: 0 2px 8px rgba(102, 192, 244, 0.4);
}

.steam-icon {
  width: 36px !important;
  height: 36px !important;
  border-radius: 10px !important;
  flex-shrink: 0;
}

.steam-icon img {
  border-radius: 10px !important;
}

.steam-text {
  flex: 1;
  min-width: 0;
}

.steam-name {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 2px;
}

.steam-desc {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.3;
}

.steam-arrow {
  color: var(--text-dim);
  flex-shrink: 0;
  transition: transform 0.3s, color 0.3s;
}

.steam-card:hover .steam-arrow {
  color: #66c0f4;
  transform: translateX(3px);
}

.footer {
  margin-top: 28px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  animation: fadeUp 0.8s 0.5s ease both;
}

.footer-card {
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.055) 0%, rgba(255, 255, 255, 0.015) 50%, rgba(255, 255, 255, 0.005) 100%);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  border-bottom: 1px solid rgba(0, 0, 0, 0.3);
  border-radius: var(--radius-md);
  padding: 13px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: all 0.3s;
  backdrop-filter: blur(20px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25), 0 1px 0 rgba(255, 255, 255, 0.06) inset, 0 -1px 0 rgba(0, 0, 0, 0.12) inset;
  text-decoration: none;
  color: inherit;
}

.footer-card:hover {
  background: var(--bg-elevated-hover);
  border-color: var(--border-blue);
  transform: translateX(2px);
}

.footer-card.is-disabled {
  cursor: default;
}

.footer-card.is-disabled:hover {
  transform: none;
  border-color: rgba(255, 255, 255, 0.06);
}

.footer-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.footer-icon svg {
  width: 18px;
  height: 18px;
}

.footer-icon.tg {
  background: linear-gradient(135deg, #29b6f6 0%, #0288d1 100%);
  color: #fff;
  box-shadow: 0 4px 12px rgba(40, 136, 209, 0.25);
}

.footer-icon.chat {
  background: linear-gradient(135deg, #5865f2 0%, #4752c4 100%);
  color: #fff;
  box-shadow: 0 4px 12px rgba(88, 101, 242, 0.25);
}

.footer-icon.vk {
  background: linear-gradient(135deg, #4a76a8 0%, #2a5278 100%);
  color: #fff;
  box-shadow: 0 4px 12px rgba(74, 118, 168, 0.25);
}

.footer-text-block {
  flex: 1;
  min-width: 0;
}

.footer-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.015em;
  margin-bottom: 2px;
}

.footer-sub {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.3;
}

.footer-arrow {
  color: var(--text-dim);
  flex-shrink: 0;
  transition: transform 0.3s, color 0.3s;
}

.footer-card:hover .footer-arrow {
  color: var(--gold);
  transform: translateX(3px);
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}
