html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000;
  color: #fff;
  font-family: Arial, sans-serif;
}

body {
  position: relative;
}

canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  display: block;
  pointer-events: none;
}

.intro-layer,
.exit-layer {
  position: fixed;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}

.intro-layer {
  background:
    radial-gradient(circle at center,
      rgba(255, 255, 255, 0.08),
      rgba(0, 0, 0, 0.90) 58%,
      rgba(0, 0, 0, 1) 100%);
  opacity: 1;
  transform: scale(1.03);
  transition: opacity 1.05s ease, transform 1.05s ease;
}

body.loaded .intro-layer {
  opacity: 0;
  transform: scale(1);
}

.exit-layer {
  background:
    radial-gradient(circle at center,
      rgba(255, 255, 255, 0.05),
      rgba(0, 0, 0, 0.84) 58%,
      rgba(0, 0, 0, 1) 100%);
  opacity: 0;
  transform: scale(1);
  transition: opacity 1.1s ease, transform 1.1s ease;
}

body.leaving .exit-layer {
  opacity: 1;
  transform: scale(1.08);
}

.topbar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 10;
  height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 22px;
  box-sizing: border-box;
  background: rgba(0, 0, 0, 0.48);
  backdrop-filter: blur(12px);
}

.back-btn {
  border: 0;
  cursor: pointer;
  color: #fff;
  font-size: 0.98rem;
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  transition: transform 0.25s ease, background 0.25s ease;
  text-decoration: none;
}

.back-btn:hover {
  transform: scale(1.06);
  background: rgba(255, 255, 255, 0.16);
}

.topbar-title {
  text-align: center;
  margin-right: 12px;
}

.topbar-title span {
  display: block;
  font-size: 1.1rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.topbar-title small {
  display: block;
  margin-top: 4px;
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  opacity: 0.72;
  text-transform: uppercase;
}

.quiz-stage {
  position: relative;
  width: 100vw;
  height: 100vh;
  z-index: 1;
}

.quiz-shell {
  position: absolute;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  width: min(1200px, 92vw);
}

.screen {
  opacity: 0;
  transform: translateY(18px) scale(0.985);
  pointer-events: none;
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.screen.is-active {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.screen-start,
.screen-end {
  min-height: 62vh;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  text-align: center;
}

.kicker {
  margin: 0 0 14px;
  font-size: 0.78rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  opacity: 0.72;
}

.screen h1,
.screen h2 {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  text-shadow:
    0 0 10px rgba(255, 255, 255, 0.9),
    0 0 20px rgba(255, 255, 255, 0.7),
    0 0 40px rgba(255, 255, 255, 0.35);
}

.screen-start h1,
.screen-end h2 {
  font-size: clamp(3rem, 7vw, 6rem);
}

.lead {
  width: min(760px, 92%);
  margin: 16px auto 0;
  font-size: clamp(1rem, 1.3vw, 1.2rem);
  line-height: 1.7;
  opacity: 0.9;
}

.start-btn,
.check-btn {
  border: 0;
  cursor: pointer;
  color: #fff;
  font-size: 1rem;
  padding: 14px 24px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.10);
  backdrop-filter: blur(10px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
  transition: transform 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
}

.start-btn:hover,
.check-btn:hover {
  transform: translateY(-1px) scale(1.03);
  background: rgba(255, 255, 255, 0.18);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
}

.start-btn {
  margin-top: 26px;
  min-width: 220px;
  padding: 16px 28px;
  font-size: 1.05rem;
  letter-spacing: 0.08em;
}

.hint {
  margin: 18px 0 0;
  font-size: 0.88rem;
  opacity: 0.7;
}

.screen-quiz {
  width: 100%;
}

.quiz-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  padding: 0 4px;
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.88;
}

.quiz-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 22px;
}

.question-panel,
.answer-panel {
  min-height: 360px;
  padding: clamp(24px, 3vw, 38px);
  border-radius: 34px;
  background: rgba(10, 10, 20, 0.58);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.11);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.38);
}

.panel-label {
  margin: 0 0 12px;
  font-size: 0.78rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  opacity: 0.7;
}

.question-panel h2 {
  font-size: clamp(2rem, 3.8vw, 4rem);
  line-height: 1.15;
  margin: 0;
  text-transform: none;
  letter-spacing: 0.02em;
  text-shadow:
    0 0 8px rgba(255, 255, 255, 0.7),
    0 0 16px rgba(255, 255, 255, 0.25);
}

.question-note {
  margin: 18px 0 0;
  font-size: 0.98rem;
  line-height: 1.6;
  opacity: 0.82;
}

.answer-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.answer-label {
  display: block;
  margin: 4px 0 12px;
  font-size: 0.92rem;
  letter-spacing: 0.06em;
  opacity: 0.85;
}

.answer-input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  padding: 16px 18px;
  font-size: 1.15rem;
  outline: none;
  transition: border-color 0.2s ease, transform 0.2s ease, background 0.2s ease;
}

.answer-input:focus {
  border-color: rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.09);
  transform: translateY(-1px);
}

.check-btn {
  margin-top: 16px;
  width: 100%;
  padding: 16px 18px;
}

.feedback {
  min-height: 2.1em;
  margin: 16px 0 0;
  font-size: 0.98rem;
  line-height: 1.5;
  opacity: 0.92;
}

.screen-end .lead {
  margin-top: 18px;
}

@media (max-width: 900px) {
  .topbar {
    height: 72px;
    padding: 0 14px;
  }

  .topbar-title span {
    font-size: 0.95rem;
  }

  .topbar-title small {
    font-size: 0.66rem;
  }

  .quiz-shell {
    width: min(92vw, 980px);
  }

  .quiz-grid {
    grid-template-columns: 1fr;
  }

  .question-panel,
  .answer-panel {
    min-height: auto;
  }
}

@media (max-width: 560px) {
  .screen-start h1,
  .screen-end h2 {
    font-size: clamp(2.5rem, 14vw, 4rem);
  }

  .lead {
    font-size: 0.98rem;
  }

  .start-btn {
    min-width: 100%;
  }

  .quiz-top {
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
  }
}