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

:root {
  --primary: #6366F1;
  --primary-dark: #4F46E5;
  --secondary: #EC4899;
  --accent: #10B981;
  --bg: #0F172A;
  --card: #1E293B;
  --card-hover: #334155;
  --text: #F8FAFC;
  --text-muted: #94A3B8;
  --border: rgba(255, 255, 255, 0.1);
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background-image: 
    radial-gradient(ellipse at 10% 20%, rgba(99, 102, 241, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse at 90% 80%, rgba(236, 72, 153, 0.1) 0%, transparent 50%);
}

.container {
  width: 100%;
  max-width: 560px;
}

/* Прогресс */
.progress-bar {
  margin-bottom: 32px;
}

.progress-info {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 8px;
  font-weight: 500;
}

.progress-track {
  height: 8px;
  background: var(--card);
  border-radius: 4px;
  overflow: hidden;
}

.progress-track__fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  border-radius: 4px;
  width: 0%;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 8px;
  text-align: center;
}

.progress-hint kbd {
  background: var(--card);
  padding: 2px 8px;
  border-radius: 4px;
  font-family: inherit;
  border: 1px solid var(--border);
}

/* Шаги */
.step {
  display: none;
  animation: fadeIn 0.5s ease;
}

.step.active {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

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

.step__icon {
  font-size: 72px;
  margin-bottom: 24px;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

.step__title {
  font-size: 1.875rem;
  font-weight: 800;
  margin-bottom: 12px;
  background: linear-gradient(135deg, var(--text), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.step__description {
  color: var(--text-muted);
  font-size: 1.1rem;
  margin-bottom: 32px;
  line-height: 1.6;
  max-width: 400px;
}

.step__description strong {
  color: var(--text);
}

/* Кнопки */
.btn {
  padding: 16px 48px;
  font-size: 1.1rem;
  font-weight: 700;
  border: none;
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: inherit;
}

.btn--primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  box-shadow: 0 8px 32px rgba(99, 102, 241, 0.4);
}

.btn--primary:hover:not(:disabled) {
  transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(99, 102, 241, 0.5);
}

.btn--primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

.btn--secondary {
  margin-top: 16px;
  background: var(--card);
  color: var(--text);
  border: 2px solid var(--border);
}

.btn--secondary:hover {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.1);
}

.btn--restart {
  margin-top: 16px;
  background: linear-gradient(135deg, var(--secondary), var(--primary));
}

/* Инпуты */
.input {
  width: 100%;
  max-width: 320px;
  padding: 18px 24px;
  font-size: 1.1rem;
  border: 2px solid var(--border);
  border-radius: 16px;
  background: var(--card);
  color: var(--text);
  text-align: center;
  margin-bottom: 24px;
  font-family: inherit;
  transition: all 0.3s;
}

.input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.2);
}

.input::placeholder {
  color: var(--text-muted);
}

.input--textarea {
  min-height: 100px;
  resize: vertical;
  text-align: left;
  padding: 16px;
}

/* Опции */
.options-grid {
  display: grid;
  gap: 12px;
  width: 100%;
  max-width: 440px;
  margin-bottom: 24px;
}

.options-grid--2 {
  grid-template-columns: repeat(2, 1fr);
}

.options-grid--3 {
  grid-template-columns: repeat(3, 1fr);
}

.options-grid--4 {
  grid-template-columns: repeat(4, 1fr);
}

.option {
  padding: 16px 12px;
  font-size: 0.95rem;
  font-weight: 600;
  border: 2px solid var(--border);
  border-radius: 14px;
  background: var(--card);
  color: var(--text);
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: inherit;
  line-height: 1.4;
}

.option small {
  display: block;
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--text-muted);
  margin-top: 4px;
}

.option:hover {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.1);
  transform: translateY(-2px);
}

.option.selected {
  border-color: var(--primary);
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(236, 72, 153, 0.2));
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.3);
}

.option.selected::before {
  content: '✓ ';
}

.option--checkbox.selected::before {
  content: none;
}

.option--checkbox.selected {
  background: rgba(16, 185, 129, 0.2);
  border-color: var(--accent);
}

/* Настроение */
.mood-selector {
  display: flex;
  gap: 16px;
  margin-bottom: 32px;
  flex-wrap: wrap;
  justify-content: center;
}

.mood {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-size: 48px;
  background: var(--card);
  border: 3px solid var(--border);
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.3s ease;
  padding: 16px;
  min-width: 80px;
}

.mood__label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

.mood:hover {
  transform: translateY(-4px) scale(1.05);
  background: var(--card-hover);
}

.mood.selected {
  border-color: var(--secondary);
  background: rgba(236, 72, 153, 0.15);
  transform: scale(1.1);
}

/* Рейтинг */
.rating-selector {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
  justify-content: center;
}

.rating {
  width: 48px;
  height: 48px;
  font-size: 1.1rem;
  font-weight: 700;
  border: 3px solid var(--border);
  border-radius: 12px;
  background: var(--card);
  color: var(--text);
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: inherit;
}

.rating:hover {
  border-color: var(--secondary);
  transform: translateY(-4px);
  background: rgba(236, 72, 153, 0.1);
}

.rating.selected {
  border-color: var(--secondary);
  background: linear-gradient(135deg, var(--secondary), var(--primary));
  transform: scale(1.1);
}

.rating--gold {
  background: linear-gradient(135deg, #FFD700, #FFA500);
  color: #000;
}

.rating--gold.selected {
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
}

.rating-label {
  font-size: 1.2rem;
  color: var(--secondary);
  font-weight: 600;
  margin-bottom: 24px;
  min-height: 28px;
}

/* Результат */
.confetti {
  font-size: 64px;
  margin-bottom: 16px;
  animation: spin 2s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.result-title {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.result-subtitle {
  color: var(--text-muted);
  font-size: 1.1rem;
  margin-bottom: 32px;
}

.result-card {
  background: var(--card);
  border-radius: 24px;
  padding: 28px;
  text-align: left;
  border: 1px solid var(--border);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.4);
  width: 100%;
  max-width: 480px;
}

.result-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.result-avatar {
  font-size: 64px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 50%;
  padding: 8px;
  line-height: 1;
}

.result-info {
  flex: 1;
}

.result-name {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.result-location {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.result-badge {
  display: inline-block;
  padding: 10px 20px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 30px;
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 24px;
}

.result-sections {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.result-section h4 {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 10px;
}

.result-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.result-row:last-child {
  border-bottom: none;
}

.result-row span {
  color: var(--text-muted);
}

.result-row strong {
  font-weight: 600;
}

.result-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.result-tag {
  padding: 8px 14px;
  background: rgba(99, 102, 241, 0.15);
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
  border: 1px solid rgba(99, 102, 241, 0.3);
}

.about-text {
  font-style: italic;
  color: var(--text);
  padding: 12px;
  background: rgba(99, 102, 241, 0.1);
  border-radius: 10px;
}

.result-section.hidden {
  display: none;
}

/* Рейтинг в результатах */
.rating-display {
  background: linear-gradient(135deg, #FFD700, #FFA500);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 700;
}

/* Карточки анкет */
.profiles-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  max-width: 480px;
  max-height: 60vh;
  overflow-y: auto;
  padding: 4px;
  margin-bottom: 24px;
}

.profiles-count {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 8px;
  text-align: center;
}

.profiles-loading,
.profiles-empty {
  padding: 40px;
  color: var(--text-muted);
  font-size: 1.1rem;
}

.profile-card {
  background: var(--card);
  border-radius: 16px;
  padding: 20px;
  border: 1px solid var(--border);
  text-align: left;
  transition: all 0.3s ease;
}

.profile-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.2);
}

.profile-card__header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.profile-card__avatar {
  font-size: 48px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 50%;
  padding: 6px;
  line-height: 1;
}

.profile-card__info {
  flex: 1;
}

.profile-card__name {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.profile-card__meta {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.profile-card__details {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.profile-card__detail {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.profile-card__about {
  font-size: 0.9rem;
  color: var(--text);
  font-style: italic;
  padding: 10px;
  background: rgba(99, 102, 241, 0.1);
  border-radius: 10px;
  margin-top: 4px;
}

/* Адаптив */
@media (max-width: 520px) {
  .options-grid--3,
  .options-grid--4 {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .mood {
    font-size: 36px;
    padding: 12px;
    min-width: 65px;
  }
  
  .step__icon {
    font-size: 56px;
  }
  
  .step__title {
    font-size: 1.5rem;
  }
  
  .result-card {
    padding: 20px;
  }
}

@media (max-width: 380px) {
  .options-grid--2,
  .options-grid--3,
  .options-grid--4 {
    grid-template-columns: 1fr;
  }
}
