/* Профиль — кастомизация в стиле игры */

.profile-page {
  padding: 40px 20px 56px;
  min-height: calc(100vh - 72px);
}

.profile-grid {
  display: grid;
  grid-template-columns: minmax(280px, 380px) minmax(280px, 1fr);
  gap: 40px;
  align-items: start;
}

.profile-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.85rem;
  letter-spacing: 0.04em;
  margin: 0 0 8px;
  color: var(--text-heading);
}

.profile-subtitle {
  margin: 0 0 28px;
  color: var(--text-muted);
  font-size: 1rem;
  font-weight: 500;
}

/* --- Аватар-сцена (крупный, как в игре) --- */
.avatar-scene {
  position: relative;
  width: 260px;
  height: 260px;
  margin: 0 auto;
}

.avatar-background {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 35% 35%, rgba(50, 45, 52, 0.95), #0D0D0D);
  box-shadow: 0 0 0 1px var(--border), inset 0 0 60px rgba(0,0,0,0.3);
  transition: background 0.4s ease, box-shadow 0.4s ease;
}

.avatar-background.bg-concrete {
  background: radial-gradient(circle at 35% 35%, #3d3d3d, #1a1a1a);
  box-shadow: 0 0 0 1px rgba(255,255,255,0.06), inset 0 0 80px rgba(0,0,0,0.4);
}

.avatar-background.bg-neon {
  background: radial-gradient(circle at 35% 35%, #3d2d38, #1a1218);
  box-shadow: 0 0 0 1px rgba(230, 184, 175, 0.15), inset 0 0 60px rgba(180, 100, 140, 0.15);
}

.avatar-background.avatar-has-photo {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* Тонкая рамка по краям (как в играх), внутри — пустота (фото) */
.avatar-frame {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(255,255,255,0.12);
  pointer-events: none;
  background: transparent;
  transition: border-color 0.35s ease, box-shadow 0.35s ease;
}

.avatar-frame.frame-neon {
  border-width: 1px;
  border-color: rgba(230, 184, 175, 0.65);
  box-shadow: 0 0 20px rgba(230, 184, 175, 0.2), 0 0 40px rgba(230, 184, 175, 0.1);
}

/* --- Рамки в стиле мобильных игр: тонкая линия по контуру + свечение снаружи, внутри пусто --- */
.avatar-frame.frame-portal-blue {
  border: 1px solid rgba(80, 160, 255, 0.9);
  box-shadow: 0 0 25px rgba(80, 160, 255, 0.4), 0 0 50px rgba(60, 140, 255, 0.2);
  animation: frame-portal-pulse 2.5s ease-in-out infinite;
}

.avatar-frame.frame-portal-orange {
  border: 1px solid rgba(255, 160, 60, 0.9);
  box-shadow: 0 0 25px rgba(255, 160, 60, 0.4), 0 0 50px rgba(255, 140, 50, 0.2);
  animation: frame-portal-pulse 2.5s ease-in-out infinite;
}

.avatar-frame.frame-neon-pink {
  border: 1px solid rgba(255, 100, 180, 0.85);
  box-shadow: 0 0 20px rgba(255, 100, 180, 0.35), 0 0 40px rgba(255, 120, 200, 0.15);
}

.avatar-frame.frame-neon-red {
  border: 1px solid rgba(255, 70, 70, 0.9);
  box-shadow: 0 0 20px rgba(255, 70, 70, 0.4), 0 0 40px rgba(255, 80, 80, 0.15);
}

.avatar-frame.frame-leaves {
  border: 1px solid rgba(60, 140, 80, 0.75);
  box-shadow: 0 0 20px rgba(80, 160, 100, 0.25);
}

.avatar-frame.frame-cloud {
  border: 1px solid rgba(220, 230, 255, 0.55);
  box-shadow: 0 0 20px rgba(240, 248, 255, 0.2);
}

.avatar-frame.frame-solid {
  border: 2px solid #2a2a2a;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.04);
}

@keyframes frame-portal-pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 25px rgba(80, 160, 255, 0.4), 0 0 50px rgba(60, 140, 255, 0.2); }
  50% { opacity: 0.95; box-shadow: 0 0 35px rgba(80, 160, 255, 0.5), 0 0 60px rgba(60, 140, 255, 0.25); }
}

.avatar-frame.frame-portal-orange { animation: frame-portal-pulse-orange 2.5s ease-in-out infinite; }
@keyframes frame-portal-pulse-orange {
  0%, 100% { box-shadow: 0 0 25px rgba(255, 160, 60, 0.4), 0 0 50px rgba(255, 140, 50, 0.2); }
  50% { box-shadow: 0 0 35px rgba(255, 160, 60, 0.5), 0 0 60px rgba(255, 140, 50, 0.25); }
}

.avatar-scene.shape-circle .avatar-background,
.avatar-scene.shape-circle .avatar-frame {
  border-radius: 50%;
  clip-path: none;
}

.avatar-scene.shape-square .avatar-background,
.avatar-scene.shape-square .avatar-frame {
  border-radius: 26px;
  clip-path: none;
}

.avatar-scene.shape-triangle .avatar-background,
.avatar-scene.shape-triangle .avatar-frame {
  border-radius: 0;
  clip-path: polygon(50% 0, 0 100%, 100% 100%);
  overflow: hidden;
}

/* --- Блок кастомизации: карточки как в инвентаре --- */
.profile-customization {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
}

.profile-group + .profile-group {
  margin-top: 28px;
}

.profile-photo-desc {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  margin: -4px 0 14px 0;
}

.profile-photo-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.profile-group h2 {
  margin: 0 0 14px;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text);
}

.cosmetic-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 12px;
}

.cosmetic-row-frames {
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 10px;
}

.cosmetic-row-frames .cosmetic-card .card-preview {
  width: 48px;
  height: 48px;
}

.cosmetic-row-frames .card-label {
  font-size: 0.8rem;
  font-weight: 500;
}

.cosmetic-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 14px 10px;
  background: rgba(15, 15, 15, 0.6);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.2s ease;
}

.cosmetic-card:hover {
  border-color: var(--border-accent);
  box-shadow: 0 0 20px rgba(0,0,0,0.2);
  transform: translateY(-2px);
}

.cosmetic-card.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), 0 0 20px var(--accent-glow);
}

.cosmetic-card .card-preview {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.06);
  background: rgba(25, 25, 25, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.cosmetic-card[data-value="neon"] .card-preview {
  border-color: rgba(230, 184, 175, 0.4);
  box-shadow: inset 0 0 12px rgba(230, 184, 175, 0.1), 0 0 12px rgba(230, 184, 175, 0.15);
}

.cosmetic-card[data-value="portal-blue"] .card-preview {
  border: 2px solid rgba(80, 160, 255, 0.85);
  box-shadow: 0 0 14px rgba(80, 160, 255, 0.4);
}

.cosmetic-card[data-value="portal-orange"] .card-preview {
  border: 2px solid rgba(255, 160, 60, 0.85);
  box-shadow: 0 0 14px rgba(255, 160, 60, 0.4);
}

.cosmetic-card[data-value="neon-pink"] .card-preview {
  border: 2px solid rgba(255, 100, 180, 0.8);
  box-shadow: 0 0 12px rgba(255, 100, 180, 0.35);
}

.cosmetic-card[data-value="neon-red"] .card-preview {
  border: 2px solid rgba(255, 70, 70, 0.85);
  box-shadow: 0 0 12px rgba(255, 70, 70, 0.35);
}

.cosmetic-card[data-value="leaves"] .card-preview {
  border: 2px solid rgba(60, 140, 80, 0.6);
  box-shadow: inset 0 0 8px rgba(50, 120, 70, 0.15), 0 0 10px rgba(80, 160, 100, 0.2);
}

.cosmetic-card[data-value="cloud"] .card-preview {
  border: 2px solid rgba(220, 230, 255, 0.4);
  box-shadow: 0 0 10px rgba(240, 248, 255, 0.2);
}

.cosmetic-card[data-value="solid"] .card-preview {
  border: 3px solid #1a1a1a;
  box-shadow: inset 0 0 12px rgba(0,0,0,0.4);
}

.cosmetic-card .card-label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text);
  text-align: center;
  line-height: 1.25;
}

.cosmetic-card.active .card-label {
  color: var(--accent);
}

.profile-note {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  line-height: 1.55;
}

/* Контейнер и ссылка «назад» */
.profile-container {
  position: relative;
}

.profile-back-wrap {
  margin-bottom: 20px;
}

.profile-back-link {
  font-size: 0.9rem;
  color: var(--text-muted);
  transition: color 0.2s ease;
}

.profile-back-link:hover {
  color: var(--accent);
}

/* Карточка с данными профиля (имя, возраст, описание, дата регистрации) */
.profile-info-card {
  margin-top: 28px;
  padding: 20px 24px;
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
}

.profile-info-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 16px;
}

.profile-info-row:last-child {
  margin-bottom: 0;
}

.profile-info-label {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.profile-info-value {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-heading);
}

.profile-info-level {
  color: var(--accent);
  font-weight: 600;
}

.profile-info-bio {
  white-space: pre-wrap;
  line-height: 1.5;
}

.profile-info-status {
  display: flex;
  align-items: center;
  gap: 8px;
}

.profile-status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.profile-status-dot.profile-status-online {
  background: #22c55e;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.35);
}

.profile-status-dot.profile-status-offline {
  background: var(--text-muted);
  opacity: 0.8;
}

.profile-status-text {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-heading);
}

/* Полученные подарки — инвентарь */
.profile-gifts-card {
  margin-top: 24px;
  padding: 20px;
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.profile-gifts-title {
  margin: 0 0 8px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-heading);
  letter-spacing: 0.06em;
}

.profile-gifts-desc {
  margin: 0 0 16px;
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.profile-gifts-inventory {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
}

.profile-gift-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.profile-gift-name {
  font-weight: 500;
  color: var(--text);
}

.profile-gift-count {
  font-weight: 600;
  color: var(--accent);
}

.profile-gifts-empty {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.profile-gifts-total {
  margin: 12px 0 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
}

.profile-gifts-total span {
  color: var(--accent);
}

/* Блок редактирования данных и приватности */
.profile-edit-block {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.profile-edit-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 18px;
}

.profile-edit-form .label-text {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}

.profile-edit-form input[type="text"],
.profile-edit-form input[type="number"],
.profile-edit-form textarea {
  width: 100%;
  padding: 10px 14px;
  background: rgba(15, 15, 15, 0.7);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  transition: border-color 0.2s ease;
}

.profile-edit-form input:focus,
.profile-edit-form textarea:focus {
  outline: none;
  border-color: var(--border-accent);
}

.profile-edit-form textarea {
  resize: vertical;
  min-height: 80px;
}

.profile-privacy {
  margin: 22px 0 20px;
  padding: 18px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.profile-privacy .privacy-title {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 14px;
}

.privacy-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text);
}

.privacy-toggle:last-child {
  margin-bottom: 0;
}

.privacy-toggle input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.profile-demo-links {
  margin-top: 12px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
}

.profile-demo-links a {
  color: var(--accent);
}

.profile-demo-links a:hover {
  text-decoration: underline;
}

@media (max-width: 640px) {
  .profile-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }
  .avatar-scene {
    width: 220px;
    height: 220px;
  }
  .avatar-frame {
    inset: 16px;
  }
}

/* Цвет сайта: превью в карточках */
.profile-theme-desc {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  margin: -8px 0 12px 0;
}

.theme-row .theme-preview {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid transparent;
}

.theme-preview.theme-rose {
  background: linear-gradient(135deg, #c9a89e, #b8986a);
}

.theme-preview.theme-blue {
  background: linear-gradient(135deg, #7aa8d4, #5a8ab8);
}

.theme-preview.theme-green {
  background: linear-gradient(135deg, #7ab87a, #5a9a5a);
}

.theme-preview.theme-purple {
  background: linear-gradient(135deg, #a88ad4, #8a6ab8);
}

.theme-preview.theme-amber {
  background: linear-gradient(135deg, #d4b87a, #b8985a);
}

.theme-preview.theme-coral {
  background: linear-gradient(135deg, #d48a7a, #b86a6a);
}
