/* === Подключение шрифтов === */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;600;700;800&family=Russo+One&display=swap');

/* === Сброс и базовые настройки === */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg-dark: #0a0a0f;
  --bg-card: rgba(15, 15, 30, 0.7);
  --neon-blue: #00d4ff;
  --neon-purple: #b347ea;
  --neon-green: #39ff14;
  --neon-pink: #ff2d95;
  --neon-gold: #ffd700;
  --text-light: #e0e0f0;
  --text-dim: #8888aa;
  --glass-border: rgba(255, 255, 255, 0.1);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

html, body {
  width: 100%;
  min-height: 100vh;
  font-family: 'Montserrat', sans-serif;
  background: var(--bg-dark);
  color: var(--text-light);
  overflow-x: hidden;
  line-height: 1.7;
  word-spacing: 0.05em;
  letter-spacing: 0.02em;
}

body::before {
  content: '';
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: 
    radial-gradient(ellipse at 20% 20%, rgba(179, 71, 234, 0.08) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 80%, rgba(0, 212, 255, 0.08) 0%, transparent 60%),
    radial-gradient(ellipse at 50% 50%, rgba(255, 45, 149, 0.04) 0%, transparent 70%);
  z-index: 0;
  pointer-events: none;
  animation: bgPulse 8s ease-in-out infinite alternate;
}

@keyframes bgPulse {
  0% { opacity: 0.6; }
  100% { opacity: 1; }
}

.screen {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 2rem 1.5rem;
  gap: 1.2rem;
  animation: fadeSlideIn 0.5s ease-out;
}

@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.hidden {
  display: none !important;
}

h1, h2 {
  font-family: 'Russo One', sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-align: center;
}

h1 {
  font-size: clamp(2rem, 6vw, 3.5rem);
  background: linear-gradient(135deg, var(--neon-blue), var(--neon-purple), var(--neon-pink));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 18px rgba(179, 71, 234, 0.6));
  margin-bottom: 0.5rem;
  animation: titleGlow 3s ease-in-out infinite alternate;
}

@keyframes titleGlow {
  0% { filter: drop-shadow(0 0 12px rgba(179, 71, 234, 0.5)); }
  100% { filter: drop-shadow(0 0 25px rgba(0, 212, 255, 0.7)); }
}

h2 {
  font-size: clamp(1.2rem, 3vw, 1.8rem);
  color: var(--neon-blue);
  text-shadow: 0 0 10px rgba(0, 212, 255, 0.3);
  line-height: 1.5;
  word-spacing: 0.08em;
}

#screen-test, #screen-report {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  box-shadow: var(--glass-shadow);
  padding: 2.5rem 2rem;
  max-width: 700px;
  width: 100%;
  margin: 0 auto;
}

#screen-start {
  gap: 2.5rem;
}

#screen-start h1 {
  font-size: clamp(2.5rem, 8vw, 4.5rem);
}

/* === КАРТОЧКИ ПЕРСОНАЖЕЙ И ХАРАКТЕРИСТИКИ === */
.character-card {
  display: flex;
  align-items: center;
  justify-content: center;   /* основная карточка центрируется */
  gap: 15px;
  transition: transform 0.3s ease;
}

.character-card img {
  border-radius: 16px;
  object-fit: cover;
  border: 2px solid var(--neon-purple);
  box-shadow: 0 0 25px rgba(179, 71, 234, 0.4), 0 4px 15px rgba(0, 0, 0, 0.4);
  transition: transform 0.4s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  background: rgba(0, 0, 0, 0.3);
}

.character-card:hover img {
  transform: scale(1.03);
  box-shadow: 0 0 35px rgba(0, 212, 255, 0.6), 0 6px 20px rgba(0, 0, 0, 0.5);
  border-color: var(--neon-blue);
}

/* Блок характеристик изначально скрыт */
.character-stats {
  opacity: 0;
  transform: translateX(25px);
  max-width: 0;
  overflow: hidden;
  transition: opacity 0.4s ease, transform 0.4s ease, max-width 0.4s ease;
  display: flex;
  flex-direction: column;
  gap: 8px;
  white-space: nowrap;
}

.stat-line {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--text-light);
  letter-spacing: 0.03em;
}

.stat-icon {
  width: 24px;
  height: 24px;
  object-fit: contain;
  filter: drop-shadow(0 0 6px var(--neon-blue));
}

/* Активное состояние после ответа */
.reveal-stats .character-stats {
  opacity: 1;
  transform: translateX(0);
  max-width: max-content;   /* без обрезания */
  overflow: visible;
}

.reveal-stats img {
  transform: translateX(-10px);
}

/* Детская карточка: отключаем сдвиг фото */
.child-card.reveal-stats img {
  transform: none;
}

/* Детские карточки – выравнивание влево */
.child-card {
  justify-content: flex-start;
}

/* Карточки детей */
.child-card img {
  width: 80px;
  height: auto;
}
.child-card .stat-icon {
  width: 20px;
  height: 20px;
}

/* === Контейнер с вопросами === */
#questions-container {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin: 1rem 0;
}

.unit-block {
  background: rgba(20, 20, 40, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 1.2rem;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.3rem;
}

.unit-block:hover {
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.unit-block h4 {
  font-family: 'Russo One', sans-serif;
  font-size: 1.1rem;
  color: var(--neon-blue);
  margin-bottom: 0.2rem;
  letter-spacing: 0.05em;
}

.unit-block p {
  font-weight: 600;
  margin-bottom: 0.5rem;
  margin-top: 0.5rem;
  color: var(--text-light);
  line-height: 1.8;
  word-spacing: 0.06em;
}

.unit-block label {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  width: 100%;
  padding: 0.7rem 1rem;
  margin: 0.3rem 0;
  border-radius: 10px;
  cursor: pointer;
  transition: var(--transition);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid transparent;
  font-size: 0.95rem;
  line-height: 1.6;
  word-spacing: 0.04em;
  box-sizing: border-box;
}

.unit-block label:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.15);
}

.unit-block input[type="radio"],
.unit-block input[type="checkbox"] {
  accent-color: var(--neon-purple);
  width: 20px;
  height: 20px;
  cursor: pointer;
  flex-shrink: 0;
  margin: 0;
}

label.correct-answer {
  font-weight: 700;
  background: linear-gradient(135deg, rgba(57, 255, 20, 0.2), rgba(0, 212, 255, 0.2)) !important;
  border: 1px solid var(--neon-green) !important;
  box-shadow: 0 0 15px rgba(57, 255, 20, 0.3);
  color: #fff !important;
}

label.incorrect-answer {
  background: rgba(255, 45, 149, 0.2) !important;
  border: 1px solid var(--neon-pink) !important;
  box-shadow: 0 0 15px rgba(255, 45, 149, 0.3);
}

/* === Кнопки === */
button {
  font-family: 'Russo One', sans-serif;
  font-size: 1rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.8rem 2rem;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
  color: #fff;
  outline: none;
  min-width: 180px;
}

#btn-start, #btn-confirm {
  background: linear-gradient(135deg, var(--neon-purple), #7b2ff7);
  box-shadow: 0 4px 20px rgba(179, 71, 234, 0.5);
}

#btn-start:hover, #btn-confirm:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(179, 71, 234, 0.7);
}

#btn-start:active, #btn-confirm:active {
  transform: translateY(0);
  box-shadow: 0 2px 10px rgba(179, 71, 234, 0.4);
}

#btn-continue {
  background: linear-gradient(135deg, var(--neon-blue), #0077ff);
  box-shadow: 0 4px 20px rgba(0, 212, 255, 0.4);
}

#btn-continue:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(0, 212, 255, 0.6);
}

#btn-stop {
  background: transparent;
  border: 2px solid var(--neon-pink);
  color: var(--neon-pink);
  box-shadow: none;
}

#btn-stop:hover {
  background: rgba(255, 45, 149, 0.15);
  box-shadow: 0 0 25px rgba(255, 45, 149, 0.4);
  transform: translateY(-2px);
}

#btn-restart {
  background: linear-gradient(135deg, var(--neon-gold), #ff8c00);
  box-shadow: 0 4px 20px rgba(255, 215, 0, 0.4);
  color: #1a1a2e;
}

#btn-restart:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(255, 215, 0, 0.6);
}

button::after {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  width: 0; height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

button:active::after {
  width: 300px;
  height: 300px;
}

#score-current {
  font-family: 'Russo One', sans-serif;
  font-size: 1.2rem;
  padding: 0.6rem 1.5rem;
  background: rgba(15, 15, 30, 0.8);
  border: 1px solid var(--glass-border);
  border-radius: 50px;
  color: var(--neon-gold);
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

#feedback {
  min-height: 1.5rem;
  font-weight: 600;
  font-size: 1.1rem;
  text-align: center;
  padding: 0.5rem;
  border-radius: 12px;
  transition: all var(--transition);
}

#feedback:not(:empty) {
  background: rgba(20, 20, 40, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  padding: 0.8rem 1.5rem;
}

#screen-report {
  text-align: center;
}

#report-title {
  font-size: 2rem;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, var(--neon-green), var(--neon-blue));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

#report-total, #report-correct {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-dim);
}

#report-correct {
  color: var(--neon-green);
  text-shadow: 0 0 8px rgba(57, 255, 20, 0.3);
}

body::after {
  content: '';
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background-image: 
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 40px 40px;
  z-index: 0;
  pointer-events: none;
}

/* === Адаптивность === */
@media (max-width: 768px) {
  .screen {
    padding: 1.5rem 1rem;
    gap: 1rem;
  }
  #screen-test, #screen-report {
    padding: 1.8rem 1.2rem;
    border-radius: 18px;
  }
  h1 { font-size: 1.8rem; }
  h2 { font-size: 1.1rem; }
  button {
    padding: 0.7rem 1.5rem;
    font-size: 0.9rem;
    min-width: 140px;
  }
  #fighter-img, #wave-img {
    width: 120px;
  }
  .unit-block {
    padding: 1rem;
  }
  .unit-block label {
    gap: 0.8rem;
  }
}

@media (max-width: 400px) {
  #screen-test, #screen-report {
    padding: 1.2rem 0.8rem;
    border-radius: 14px;
  }
  button {
    min-width: 120px;
    padding: 0.6rem 1.2rem;
    font-size: 0.8rem;
  }
  #score-current {
    font-size: 1rem;
    padding: 0.5rem 1rem;
  }
}