* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: linear-gradient(135deg, #eef2ff 0%, #fdf2f8 50%, #ecfeff 100%);
  background-attachment: fixed;
  color: #1e293b;
  line-height: 1.6;
  padding: 20px;
  min-height: 100vh;
}

.screen {
  max-width: 800px;
  margin: 40px auto;
  background: #ffffff;
  border-radius: 20px;
  padding: 40px;
  box-shadow: 0 10px 40px rgba(99, 102, 241, 0.12), 0 2px 8px rgba(0,0,0,0.04);
  border: 1px solid rgba(99, 102, 241, 0.08);
}

h1 {
  font-size: 28px;
  margin-bottom: 20px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6, #ec4899);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

h2 {
  font-size: 22px;
  margin: 35px 0 20px;
  padding-bottom: 10px;
  border-bottom: 3px solid #e0e7ff;
  color: #4f46e5;
}

h3 { font-size: 18px; margin: 20px 0 10px; color: #334155; }

p { margin-bottom: 15px; }

/* === Кнопки возраста === */
.age-buttons {
  display: flex;
  gap: 15px;
  margin-top: 25px;
  flex-wrap: wrap;
}

.age-buttons button {
  flex: 1;
  min-width: 150px;
  padding: 22px 18px;
  font-size: 17px;
  font-weight: 600;
  color: #fff;
  border: none;
  border-radius: 14px;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  position: relative;
  overflow: hidden;
}

.age-buttons button:nth-child(1) {
  background: linear-gradient(135deg, #f59e0b, #f97316);
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.35);
}
.age-buttons button:nth-child(2) {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.35);
}
.age-buttons button:nth-child(3) {
  background: linear-gradient(135deg, #06b6d4, #0891b2);
  box-shadow: 0 6px 20px rgba(6, 182, 212, 0.35);
}

.age-buttons button:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 28px rgba(0,0,0,0.2);
}

.age-buttons button:active {
  transform: translateY(-1px);
}

/* === Прогресс-бар (залипающий) === */
.progress-sticky {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 12px 0;
  margin: -10px 0 25px 0;
  border-bottom: 1px solid #e0e7ff;
}

.progress-bar {
  height: 8px;
  background: #e0e7ff;
  border-radius: 4px;
  overflow: hidden;
}

#progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #6366f1, #8b5cf6, #ec4899);
  width: 0%;
  transition: width 0.4s ease;
  border-radius: 4px;
  box-shadow: 0 0 10px rgba(139, 92, 246, 0.5);
}

.progress-label {
  text-align: center;
  font-size: 12px;
  color: #64748b;
  margin-top: 6px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

/* === Вопросы === */
.question {
  margin-bottom: 30px;
  padding: 20px;
  background: #fafbff;
  border-radius: 12px;
  border: 1px solid #eef2ff;
  transition: background 0.2s;
}

.question:hover {
  background: #f5f7ff;
}

.question p {
  font-weight: 600;
  margin-bottom: 14px;
  color: #1e293b;
  font-size: 16px;
}

.options { display: flex; flex-direction: column; gap: 8px; }

.options label {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s;
  background: #ffffff;
  font-size: 15px;
}

.options label:hover {
  border-color: #a5b4fc;
  background: #f0f4ff;
  transform: translateX(4px);
}

.options input[type="radio"] {
  margin-right: 12px;
  accent-color: #6366f1;
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.options label:has(input:checked) {
  border-color: #6366f1;
  background: linear-gradient(135deg, #eef2ff, #f5f3ff);
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.15);
}

/* === Поля пропусков === */
.gap-input {
  width: 160px;
  padding: 8px 12px;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  font-size: 15px;
  font-family: inherit;
  background: #ffffff;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.gap-input:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.12);
}

/* === Аудио === */
.audio-player {
  margin: 20px 0;
  padding: 20px;
  background: linear-gradient(135deg, #f0f9ff, #eff6ff);
  border-radius: 14px;
  border: 1px solid #bfdbfe;
}

.audio-player audio {
  width: 100%;
  border-radius: 8px;
}

/* === Кнопка "Завершить" === */
#finish-btn {
  display: block;
  width: 100%;
  padding: 20px;
  font-size: 18px;
  font-weight: 700;
  background: linear-gradient(135deg, #6366f1, #8b5cf6, #ec4899);
  color: #fff;
  border: none;
  border-radius: 14px;
  cursor: pointer;
  margin-top: 40px;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 8px 24px rgba(139, 92, 246, 0.4);
  letter-spacing: 0.3px;
}

#finish-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(139, 92, 246, 0.5);
}

#finish-btn:active {
  transform: translateY(0);
}

#finish-btn:disabled {
  background: #cbd5e1;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

/* === Reading === */
.reading-text {
  background: linear-gradient(135deg, #fffbeb, #fef3c7);
  padding: 24px;
  border-radius: 14px;
  margin-bottom: 25px;
  line-height: 1.75;
  font-size: 16px;
  border-left: 5px solid #f59e0b;
  color: #422006;
}

/* === Результат === */
.result-section {
  margin-bottom: 28px;
  padding-bottom: 22px;
  border-bottom: 1px solid #e2e8f0;
}

.result-section:last-child { border-bottom: none; }

.level-badge {
  display: inline-block;
  font-size: 56px;
  font-weight: 800;
  background: linear-gradient(135deg, #6366f1, #8b5cf6, #ec4899);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 10px 0;
  letter-spacing: -2px;
}

.score {
  font-size: 20px;
  color: #64748b;
  font-weight: 600;
}

.weak-block {
  padding: 14px 18px;
  background: linear-gradient(135deg, #fef2f2, #fee2e2);
  border-left: 5px solid #ef4444;
  margin-bottom: 10px;
  border-radius: 8px;
  font-weight: 500;
  color: #991b1b;
}

.plan-block {
  padding: 14px 18px;
  background: linear-gradient(135deg, #eff6ff, #dbeafe);
  border-left: 5px solid #3b82f6;
  margin-bottom: 10px;
  border-radius: 8px;
  font-weight: 500;
  color: #1e40af;
}

/* === Анимация появления === */
.screen {
  animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* === Мобильная адаптация === */
@media (max-width: 600px) {
  .screen { padding: 24px; margin: 20px auto; border-radius: 14px; }
  h1 { font-size: 22px; }
  h2 { font-size: 18px; }
  .age-buttons button { min-width: 100%; }
  .level-badge { font-size: 42px; }
  .gap-input { width: 120px; }
}