:root {
  --blue: #3564d8;
  --blue-dark: #163f87;
  --green: #8bcf57;
  --yellow: #f1c500;
  --white: #ffffff;
  --text: #2f60d4;
  --shadow: 0 14px 30px rgba(0, 0, 0, 0.18);
  --red: #c93030;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  font-family: Arial, sans-serif;
  background: linear-gradient(180deg, #113b7e 0%, #0b58a0 42%, #35a9df 70%, #78ca00 100%);
  overflow-x: hidden;
}

.app {
  position: relative;
  width: 100%;
  max-width: 430px;
  min-height: 100dvh;
  margin: 0 auto;
  padding: 24px 18px 180px;
  overflow: visible;
}

.top-left-year {
  position: absolute;
  top: 36px;
  left: 22px;
  z-index: 2;
  color: var(--white);
  line-height: 0.9;
  text-transform: uppercase;
}

.top-left-year small {
  display: block;
  font-size: clamp(22px, 4vw, 30px);
  letter-spacing: 1px;
}

.top-left-year strong {
  display: block;
  font-size: clamp(70px, 12vw, 96px);
  font-weight: 800;
}

.level-badge {
  position: absolute;
  top: 24px;
  right: 16px;
  z-index: 2;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: var(--yellow);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  box-shadow: var(--shadow);
  padding: 14px;
}

.level-badge span {
  display: block;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 6px;
}

.level-badge strong {
  display: block;
  color: var(--blue);
  font-size: 28px;
  font-weight: 900;
}

.quiz-logo,
.mascot,
.footer-brand {
  position: absolute;
  pointer-events: none;
  z-index: 20;
  object-fit: contain;
}

.quiz-logo {
  top: 124px;
  left: 50%;
  transform: translateX(-50%);
  width: min(340px, 54vw);
}

.mascot {
  left: 10px;
  bottom: 105px;
  width: 145px;
}

.footer-brand {
  left: 50%;
  bottom: 108px;
  transform: translateX(-50%);
  width: 190px;
  background: none;
  border: none;
  box-shadow: none;
}

.card {
  position: relative;
  z-index: 5;
  margin-top: 180px;
  width: 100%;
  background: rgba(240, 240, 240, 0.96);
  border-radius: 36px;
  box-shadow: var(--shadow);
  padding: 170px 22px 210px;
}

#quiz-screen,
#result-screen,
#success-screen,
#error-screen {
  position: relative;
  z-index: 6;
}

.progress {
  text-align: center;
  font-size: 28px;
  font-weight: 900;
  color: var(--text);
  text-transform: uppercase;
  margin-bottom: 30px;
}

.progress b {
  display: inline-block;
  margin-left: 10px;
  padding: 12px 20px;
  border-radius: 22px;
  background: var(--blue);
  color: #fff;
}

.question {
  margin: 0 0 34px;
  text-align: center;
  color: var(--text);
  font-size: clamp(34px, 6vw, 58px);
  line-height: 1.08;
  font-weight: 900;
}

.result-title {
  margin-bottom: 10px;
}

.answers {
  display: grid;
  gap: 18px;
  position: relative;
  z-index: 10;
}

.answers button {
  width: 100%;
  min-height: 92px;
  border-radius: 34px;
  border: 6px solid var(--blue);
  background: #f4f4f4;
  color: var(--text);
  font-size: 28px;
  font-weight: 900;
  cursor: pointer;
  position: relative;
  z-index: 11;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.06);
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.answers button:hover,
.answers button:focus-visible {
  outline: none;
  transform: scale(1.01);
}

.answers button:disabled {
  opacity: 1;
  cursor: default;
}

.selected-answer {
  background: #dbe7ff !important;
  border-color: #224fbe !important;
  color: #143a96 !important;
}

.correct-answer {
  border-color: #45a92e !important;
  background: #dcf4d5 !important;
  color: #1a7d22 !important;
}

.wrong-answer {
  border-color: #d84e4e !important;
  background: #ffdede !important;
  color: #b12020 !important;
}

.feedback {
  min-height: 28px;
  margin-top: 16px;
  text-align: center;
  font-size: 18px;
  font-weight: 700;
  color: var(--blue-dark);
}

.controls {
  display: flex;
  justify-content: center;
  margin-top: 20px;
}

.btn {
  border: none;
  border-radius: 18px;
  background: var(--blue);
  color: #fff;
  padding: 14px 22px;
  font-size: 18px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: var(--shadow);
  text-decoration: none;
  text-align: center;
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.btn:hover,
.btn:focus-visible {
  transform: translateY(-1px);
  filter: brightness(1.03);
  outline: none;
}

.btn:active {
  transform: translateY(1px) scale(0.98);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.16);
}

.btn.secondary {
  background: var(--green);
}

.website-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 100%;
  white-space: nowrap;
  text-align: center;
  text-decoration: none;
  line-height: 1;
  font-size: 15px;
  padding: 16px 18px;
}

.hidden {
  display: none !important;
}

.score {
  text-align: center;
  font-size: 64px;
  line-height: 1;
  color: var(--text);
  font-weight: 900;
  margin-bottom: 12px;
}

.lead-text {
  text-align: center;
  font-size: 18px;
  line-height: 1.4;
  color: var(--blue-dark);
  margin-bottom: 20px;
}

.success-text {
  color: #1a7d22;
  font-weight: 700;
}

.error-text {
  color: var(--red);
  font-weight: 700;
}

.form-grid {
  display: grid;
  gap: 14px;
}

.input {
  width: 100%;
  border: 3px solid var(--blue);
  border-radius: 16px;
  padding: 15px 16px;
  font-size: 17px;
}

@media (max-width: 390px) {
  .app {
    padding: 20px 14px 170px;
  }

  .top-left-year {
    top: 40px;
    left: 18px;
  }

  .top-left-year small {
    font-size: 18px;
  }

  .top-left-year strong {
    font-size: 66px;
  }

  .level-badge {
    width: 128px;
    height: 128px;
    right: 12px;
  }

  .level-badge strong {
    font-size: 24px;
  }

  .quiz-logo {
    top: 140px;
    width: min(300px, 52vw);
  }

  .card {
    margin-top: 190px;
    padding: 165px 18px 200px;
    border-radius: 30px;
  }

  .progress {
    font-size: 24px;
  }

  .progress b {
    padding: 10px 16px;
  }

  .question {
    font-size: 31px;
    margin-bottom: 28px;
  }

  .answers button {
    min-height: 84px;
    font-size: 24px;
    border-width: 5px;
  }

 .mascot {
  width: 118px;
  left: 6px;
  bottom: 98px;
}

.footer-brand {
  width: 165px;
  bottom: 102px;
}

  .website-btn {
    font-size: 13px;
    padding: 15px 14px;
  }
}

.footer-legal {
  position: absolute;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  z-index: 25;
  width: calc(100% - 40px);
  text-align: center;
}

.footer-legal a {
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.footer-legal a:hover,
.footer-legal a:focus-visible {
  text-decoration: underline;
  outline: none;
}

.level-badge.easy {
  background: #8bcf57;
}

.level-badge.medium {
  background: #f39c12;
}

.level-badge.hard {
  background: #e74c3c;
}

.level-badge.easy strong,
.level-badge.medium strong,
.level-badge.hard strong {
  color: #ffffff;
}

.level-badge {
  transition: background 0.3s ease, transform 0.2s ease;
}

.level-badge.easy { transform: scale(1.02); }
.level-badge.medium { transform: scale(1.04); }
.level-badge.hard { transform: scale(1.06); }