:root {
  --bg: #0e0c0a;
  --panel: #161210;
  --card: #1c1714;
  --border: rgba(255, 255, 255, 0.06);
  --gold: #e8c07a;
  --gold-dim: #8a7a63;
  --gold-faint: #71634e;
  --text: #e8dcc4;
  --accent-line: rgba(217, 163, 74, 0.3);
  --green: #7fbf6a;
  --red: #d97a5c;
  --silver: #c9c9c9;
  --vip: #e07a5f;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
}

#app-root {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--panel);
  position: relative;
  padding-bottom: 84px;
}

.loading,
.error {
  text-align: center;
  padding: 60px 20px;
  color: var(--gold-dim);
  font-size: 14px;
  line-height: 1.5;
}

/* Шапка */
.header {
  padding: 22px 20px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.header .club-name {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 26px;
  letter-spacing: 6px;
  color: var(--gold);
  font-weight: 600;
}

.header .club-subtitle {
  font-size: 10px;
  letter-spacing: 3px;
  color: var(--gold-dim);
  margin-top: 3px;
  text-transform: uppercase;
}

/* Экраны */
.screen {
  padding: 16px 16px 10px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.screen-title {
  color: var(--text);
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 2px;
}

/* Баннеры */
.banner {
  border-radius: 16px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.banner-gift {
  background: linear-gradient(135deg, #3a2a12, #2a1e10);
  border: 1px solid var(--accent-line);
  cursor: pointer;
}

.banner-birthday {
  background: linear-gradient(135deg, #402318, #2a1712);
  border: 1px solid rgba(196, 108, 74, 0.4);
}

.banner-title {
  color: var(--gold);
  font-size: 14px;
  font-weight: 700;
}

.banner-sub {
  color: var(--gold-dim);
  font-size: 12px;
  margin-top: 2px;
}

.banner-birthday .banner-title { color: #e8b394; }
.banner-birthday .banner-sub { color: #b8967f; }

/* Карточка баланса */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 16px 18px;
}

.card-balance {
  background: linear-gradient(160deg, #26201a, #1a1512);
  border: 1px solid rgba(217, 163, 74, 0.18);
  border-radius: 20px;
  padding: 22px 20px;
  position: relative;
  overflow: hidden;
}

.balance-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  position: relative;
  z-index: 1;
}

.balance-label {
  color: var(--gold-dim);
  font-size: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.balance-value {
  color: #f5eadb;
  font-size: 34px;
  font-weight: 700;
  margin-top: 6px;
}

.balance-value .cur {
  font-size: 16px;
  color: var(--gold-dim);
  font-weight: 500;
}

.level-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: rgba(217, 163, 74, 0.1);
  border: 1px solid var(--accent-line);
  border-radius: 12px;
  padding: 8px 12px;
  flex-shrink: 0;
}

.level-badge .name {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.balance-stats {
  display: flex;
  gap: 18px;
  margin-top: 18px;
  position: relative;
  z-index: 1;
}

.balance-stat-label {
  color: var(--gold-dim);
  font-size: 11px;
}

.balance-stat-value {
  color: var(--gold);
  font-size: 16px;
  font-weight: 700;
  margin-top: 2px;
}

.balance-divider {
  width: 1px;
  background: rgba(255, 255, 255, 0.08);
}

/* Прогресс уровня */
.row-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-title {
  color: #d8c8ac;
  font-size: 13px;
  font-weight: 600;
}

.progress-track {
  height: 8px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 4px;
  margin-top: 10px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #8a6018, var(--gold));
  border-radius: 4px;
  transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
  width: 0%;
}

.progress-note {
  color: var(--gold-faint);
  font-size: 11px;
  margin-top: 8px;
}

/* Визиты */
.visits-row {
  display: flex;
  justify-content: space-between;
  position: relative;
  margin-bottom: 4px;
}

.visits-line {
  position: absolute;
  top: 14px;
  left: 14px;
  right: 14px;
  height: 2px;
  background: rgba(255, 255, 255, 0.08);
  z-index: 0;
}

.visit-milestone {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 60px;
}

.visit-circle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  border: 2px solid rgba(217, 163, 74, 0.3);
  background: rgba(217, 163, 74, 0.08);
  color: var(--gold-dim);
}

.visit-milestone.done .visit-circle { background: var(--gold); border-color: var(--gold); color: #1a1512; }
.visit-milestone.current .visit-circle { background: rgba(217, 163, 74, 0.15); border-color: var(--gold); color: var(--gold); }

.visit-label {
  color: var(--gold-dim);
  font-size: 10px;
  text-align: center;
  line-height: 1.3;
}

/* Квесты */
.quest-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.quest-title {
  color: #e8dcc4;
  font-size: 12.5px;
}

.quest-progress-label {
  color: var(--gold-dim);
  font-size: 11px;
}

.quest-track {
  height: 6px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 3px;
  overflow: hidden;
}

.quest-fill {
  height: 100%;
  background: linear-gradient(90deg, #8a6018, var(--gold));
  border-radius: 3px;
  width: 0%;
  transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

/* История */
.history-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.history-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.history-icon.credit { background: rgba(127, 191, 106, 0.12); }
.history-icon.debit { background: rgba(217, 122, 92, 0.12); }

.history-title {
  color: #e8dcc4;
  font-size: 13px;
  font-weight: 600;
}

.history-date {
  color: var(--gold-faint);
  font-size: 11px;
  margin-top: 2px;
}

.history-amount {
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
}

.history-amount.credit { color: var(--green); }
.history-amount.debit { color: var(--red); }

.history-cancelled {
  text-decoration: line-through;
  opacity: 0.5;
}

/* QR-экран */
.qr-screen {
  align-items: center;
  gap: 18px;
  padding-top: 30px;
  text-align: center;
}

.qr-card {
  background: #f5eadb;
  border-radius: 24px;
  padding: 28px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

.qr-card img {
  display: block;
  width: 220px;
  height: 220px;
}

.qr-member-id {
  color: var(--gold-faint);
  font-size: 11px;
  letter-spacing: 1px;
}

/* Привилегии */
.level-tier-card {
  background: var(--card);
  border-radius: 16px;
  padding: 16px;
  border: 1px solid var(--border);
}

.level-tier-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.level-tier-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.level-tier-name {
  font-size: 14px;
  font-weight: 700;
}

.level-tier-threshold {
  color: var(--gold-faint);
  font-size: 11px;
}

.level-tier-perks {
  color: var(--gold-dim);
  font-size: 12px;
  margin-top: 8px;
}

.gift-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.gift-icon-box {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(217, 163, 74, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.gift-card-title {
  color: #e8dcc4;
  font-size: 13px;
  font-weight: 600;
}

.gift-card-sub {
  color: var(--gold-faint);
  font-size: 11px;
  margin-top: 2px;
}

/* Профиль */
.profile-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 20px 0 10px;
}

.profile-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(160deg, #3a2a12, #26201a);
  border: 2px solid rgba(217, 163, 74, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold);
  font-size: 26px;
  font-weight: 700;
  object-fit: cover;
}

.profile-name {
  color: #e8dcc4;
  font-size: 16px;
  font-weight: 700;
}

.profile-level-pill {
  display: flex;
  align-items: center;
  gap: 5px;
  background: rgba(217, 163, 74, 0.1);
  border: 1px solid var(--accent-line);
  border-radius: 20px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 700;
}

.profile-field {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.profile-field-label {
  color: var(--gold-dim);
  font-size: 12px;
}

.profile-field-value {
  color: #e8dcc4;
  font-size: 13px;
  font-weight: 600;
}

/* Нижняя навигация */
#bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  background: rgba(20, 16, 13, 0.94);
  backdrop-filter: blur(12px);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  padding: 10px 6px 18px;
  z-index: 10;
}

.nav-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  padding: 4px 0;
  background: none;
  border: none;
  color: inherit;
  font-family: inherit;
}

.nav-tab .nav-label {
  font-size: 10px;
  color: var(--gold-faint);
  font-weight: 500;
}

.nav-tab.active .nav-label {
  color: var(--gold);
  font-weight: 700;
}

.nav-tab svg {
  stroke: var(--gold-faint);
}

.nav-tab.active svg {
  stroke: var(--gold);
}
