/* ── Reset & base ──────────────────────────────────────── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg: var(--tg-theme-bg-color, #1a1a2e);
  --text: var(--tg-theme-text-color, #e0e0e0);
  --hint: var(--tg-theme-hint-color, #888);
  --link: var(--tg-theme-link-color, #5eaaef);
  --button: var(--tg-theme-button-color, #5eaaef);
  --button-text: var(--tg-theme-button-text-color, #fff);
  --secondary-bg: var(--tg-theme-secondary-bg-color, #16162a);
  --skeleton-base: #2a2a40;
  --skeleton-shine: #3a3a55;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

#app {
  max-width: 480px;
  margin: 0 auto;
  padding: 24px 16px;
  position: relative;
  min-height: 100vh;
}

/* ── Profile card ──────────────────────────────────────── */
.profile-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 32px 16px 24px;
  background: var(--secondary-bg);
  border-radius: 16px;
  margin-bottom: 16px;
}

.avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 16px;
}

.avatar-initials {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--button);
  color: var(--button-text);
  font-size: 28px;
  font-weight: 700;
}

.profile-name {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 4px;
}

.profile-username {
  font-size: 15px;
  color: var(--hint);
  margin-bottom: 2px;
}

.profile-id {
  font-size: 13px;
  color: var(--hint);
}

/* ── Sections ──────────────────────────────────────────── */
.section {
  background: var(--secondary-bg);
  border-radius: 16px;
  padding: 20px 16px;
  margin-bottom: 16px;
}

.section-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 12px;
}

/* ── Wallet ────────────────────────────────────────────── */
.wallet-balance {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.balance-amount {
  font-size: 32px;
  font-weight: 700;
}

.balance-currency {
  font-size: 16px;
  color: var(--hint);
  font-weight: 500;
}

/* ── Game list ─────────────────────────────────────────── */
.game-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.game-card {
  background: var(--bg);
  border-radius: 12px;
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: var(--hint);
}

.placeholder-card {
  border: 1px dashed var(--hint);
}

/* ── Skeleton / shimmer ────────────────────────────────── */
.skeleton {
  background: var(--skeleton-base);
  border-radius: 8px;
}

.shimmer {
  background: linear-gradient(
    90deg,
    var(--skeleton-base) 25%,
    var(--skeleton-shine) 50%,
    var(--skeleton-base) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-name {
  width: 160px;
  height: 24px;
  margin-bottom: 8px;
}

.skeleton-username {
  width: 110px;
  height: 16px;
  margin-bottom: 6px;
}

.skeleton-id {
  width: 90px;
  height: 14px;
}

.skeleton-section-title {
  width: 80px;
  height: 18px;
  margin-bottom: 12px;
}

.skeleton-balance {
  width: 140px;
  height: 34px;
}

.skeleton-game {
  height: 100px;
  border-radius: 12px;
}

/* ── Overlay (non-Telegram) ────────────────────────────── */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.overlay-content {
  text-align: center;
  padding: 32px;
}

.overlay-text {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 20px;
  color: #fff;
}

.overlay-button {
  display: inline-block;
  padding: 14px 36px;
  background: var(--button);
  color: var(--button-text);
  font-size: 16px;
  font-weight: 600;
  border-radius: 12px;
  text-decoration: none;
  transition: opacity 0.2s;
}

.overlay-button:active {
  opacity: 0.8;
}
