/* ========== КАБІНЕТ ========== */

.cabinet-card {
  max-width: 400px;
  max-height: 85vh;
  overflow-y: auto;
  padding: 16px;
}

.cabinet-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  border-bottom: 2px solid var(--gold);
  padding-bottom: 12px;
}

/* ========== АВАТАР ========== */

.avatar-wrapper {
  position: relative;
  cursor: pointer;
}

.avatar {
  width: 55px;
  height: 55px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), #e67e22);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  overflow: hidden;
  transition: all 0.3s ease;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-edit-btn {
  position: absolute;
  bottom: -4px;
  right: -4px;
  background: var(--gold);
  border-radius: 50%;
  width: 20px;
  height: 20px;
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ========== ВКЛАДКИ ========== */

.cabinet-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 15px;
  flex-wrap: wrap;
}

.tab-btn {
  background: #2a2a3a;
  border: none;
  padding: 8px 14px;
  border-radius: 25px;
  cursor: pointer;
  font-weight: bold;
  font-size: 13px;
  color: white;
}

.tab-btn.active {
  background: var(--gold);
  color: #000;
}

.cabinet-tab {
  display: none;
}

.cabinet-tab.active {
  display: block;
}

/* ========== СЕКЦІЇ ========== */

.cabinet-section {
  background: rgba(255,255,255,0.9);
  border-radius: 16px;
  padding: 12px;
  margin-bottom: 12px;
  color: #000;
}

.cabinet-section h3 {
  margin-bottom: 10px;
  font-size: 15px;
}

/* ========== ІНФОРМАЦІЯ ========== */

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
}

.info-item {
  background: #f0f0f0;
  padding: 8px;
  border-radius: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
}

.edit-btn {
  background: var(--gold);
  border: none;
  padding: 4px 8px;
  border-radius: 8px;
  cursor: pointer;
}

/* ========== СТАТИСТИКА ========== */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.stat-card {
  background: linear-gradient(135deg, #2c3e50, #1a2632);
  padding: 8px;
  border-radius: 12px;
  text-align: center;
  color: white;
}

.stat-value {
  font-size: 18px;
  font-weight: bold;
  color: var(--gold);
}

.stat-label {
  font-size: 9px;
  color: #aaa;
}

/* ========== ЗНАЧКИ ========== */

.badges-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.badge {
  background: linear-gradient(135deg, var(--gold), #e67e22);
  padding: 4px 8px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: bold;
  color: #000;
}

.badge.locked {
  background: #555;
  color: #aaa;
  filter: grayscale(0.5);
}

/* ========== ПОКУПКИ ========== */

.purchases-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.purchase-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px;
  background: #f0f0f0;
  border-radius: 10px;
  font-size: 13px;
  flex-wrap: wrap;
  gap: 8px;
}

/* ========== ІСТОРІЯ ========== */

.history-list {
  max-height: 150px;
  overflow-y: auto;
}

.history-item {
  display: flex;
  justify-content: space-between;
  padding: 6px;
  border-bottom: 1px solid #ddd;
  font-size: 12px;
}

.history-percent {
  font-weight: bold;
  color: var(--gold);
}

/* ========== НАЛАШТУВАННЯ ========== */

.settings-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ========== ДРУЗІ ========== */

.add-friend {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.friend-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px;
  border-bottom: 1px solid #ddd;
}

.friend-info {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.friend-avatar { font-size: 24px; }
.friend-name { font-weight: bold; font-size: 13px; }
.friend-points { color: var(--gold); font-size: 11px; }
.friend-level { font-size: 12px; }

.remove-friend {
  background: var(--red);
  border: none;
  padding: 4px 8px;
  border-radius: 6px;
  color: white;
  font-size: 10px;
  cursor: pointer;
}

/* ========== ТАБЛИЦЯ ЛІДЕРІВ ========== */

.leaderboard-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px;
  border-bottom: 1px solid #ddd;
}

.leaderboard-rank {
  font-weight: bold;
  color: var(--gold);
  width: 28px;
}

/* ========== ДОСЯГНЕННЯ ========== */

.achievements-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.achievement-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px;
  background: #f0f0f0;
  border-radius: 10px;
  font-size: 12px;
}

.achievement-item.earned {
  background: linear-gradient(135deg, #2ecc71, #27ae60);
  color: white;
}

.achievement-item.locked {
  background: #ddd;
  color: #666;
}

.achievement-name { flex: 2; }
.achievement-reward { flex: 1; text-align: center; }
.achievement-status { width: 30px; text-align: center; }

/* ========== СТІКЕРИ ========== */

.stickers-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.sticker-item {
  background: #f0f0f0;
  border-radius: 12px;
  padding: 10px;
  text-align: center;
  transition: transform 0.2s;
}

.sticker-item.owned {
  background: linear-gradient(135deg, var(--gold), #e67e22);
  color: white;
}

.sticker-item.locked {
  background: #ddd;
  color: #666;
}

.sticker-emoji {
  text-align: center;
}

.sticker-emoji img {
  width: 100%;
  max-width: 100px;
  height: auto;
  aspect-ratio: 1/1;
  border-radius: 50%;
  object-fit: cover;
}

.sticker-name {
  font-weight: bold;
  font-size: 12px;
}

.sticker-desc {
  font-size: 10px;
  margin: 5px 0;
}

.sticker-status {
  font-size: 10px;
  margin-top: 5px;
}