:root {
  --bg-950: #04070b;
  --bg-900: #09111a;
  --bg-820: #101a27;
  --panel: rgba(8, 16, 28, 0.76);
  --panel-border: rgba(255, 255, 255, 0.09);
  --panel-highlight: rgba(255, 255, 255, 0.04);
  --text-main: #f4f7fb;
  --text-muted: #9dabc3;
  --accent: #ff6a3d;
  --accent-strong: #ff8d57;
  --accent-soft: rgba(255, 106, 61, 0.18);
  --success: #62f0b2;
  --danger: #ff6c88;
  --warning: #ffd36a;
  --shadow-heavy: 0 30px 90px rgba(0, 0, 0, 0.48);
  --shadow-soft: 0 12px 36px rgba(0, 0, 0, 0.26);
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 18px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Manrope", sans-serif;
  color: var(--text-main);
  background:
    radial-gradient(circle at 12% 18%, rgba(255, 106, 61, 0.20), transparent 24%),
    radial-gradient(circle at 88% 24%, rgba(255, 167, 75, 0.14), transparent 18%),
    radial-gradient(circle at 50% 100%, rgba(91, 132, 255, 0.10), transparent 24%),
    linear-gradient(135deg, var(--bg-950), var(--bg-900) 58%, var(--bg-820));
  background-attachment: fixed;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: auto;
  width: 44vw;
  height: 44vw;
  pointer-events: none;
  filter: blur(70px);
  opacity: 0.34;
  z-index: 0;
}

body::before {
  top: -12vw;
  left: -10vw;
  background: rgba(255, 106, 61, 0.26);
}

body::after {
  right: -10vw;
  bottom: -18vw;
  background: rgba(94, 157, 255, 0.18);
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

img {
  display: block;
  max-width: 100%;
}

.app-shell {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100% - 32px));
  margin: 24px auto;
}

.scene {
  min-height: calc(100vh - 48px);
  display: grid;
  align-items: center;
  opacity: 0;
  transform: translateY(24px) scale(0.985);
  pointer-events: none;
  transition: opacity 420ms ease, transform 420ms ease;
}

.scene[hidden] {
  display: none;
}

.scene.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.glass-panel {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.04), transparent 44%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0)),
    var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-heavy);
  backdrop-filter: blur(18px);
}

.eyebrow,
.question-category,
.chip-label,
.metric-label,
.progress-label,
.fact-label,
.visual-badge {
  font-family: "Oxanium", sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.scene--start {
  grid-template-columns: minmax(0, 0.95fr) minmax(320px, 0.9fr);
  gap: 24px;
}

.hero-copy {
  padding: 46px;
}

.hero-copy h1 {
  margin: 18px 0 16px;
  font-family: "Oxanium", sans-serif;
  font-size: clamp(2.7rem, 7vw, 5.3rem);
  line-height: 0.96;
  letter-spacing: -0.04em;
}

.hero-text,
.hero-note,
.result-summary {
  color: var(--text-muted);
  line-height: 1.7;
}

.hero-text {
  max-width: 56ch;
  font-size: 1.05rem;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 28px 0 34px;
}

.hero-meta span,
.score-chip,
.result-metric,
.visual-badge {
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  box-shadow: var(--shadow-soft);
}

.hero-meta span {
  padding: 10px 14px;
  border-radius: 999px;
  color: var(--text-main);
  font-size: 0.94rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px;
}

.primary-button,
.secondary-button {
  border: 0;
  border-radius: 999px;
  padding: 16px 28px;
  font-weight: 800;
  transition: transform 180ms ease, box-shadow 180ms ease, filter 180ms ease, opacity 180ms ease;
}

.primary-button {
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  box-shadow: 0 18px 40px rgba(255, 106, 61, 0.3);
}

.secondary-button {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.primary-button:hover,
.secondary-button:hover {
  transform: translateY(-2px);
  filter: brightness(1.03);
}

.primary-button:disabled,
.secondary-button:disabled {
  opacity: 0.48;
  cursor: not-allowed;
  transform: none;
  filter: none;
}

.hero-visual {
  position: relative;
  min-height: 600px;
  overflow: hidden;
  padding: 28px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  background:
    linear-gradient(180deg, rgba(5, 8, 13, 0.08), rgba(5, 8, 13, 0.72)),
    linear-gradient(90deg, rgba(255, 106, 61, 0.16), transparent 44%),
    url("https://portalhistoryua.com/wp-content/uploads/2025/05/chornobyl.jpg") center / cover;
}

.hero-visual::before {
  content: "";
  position: absolute;
  inset: auto 5% 9% auto;
  width: 42%;
  height: 34%;
  background: radial-gradient(circle at center, rgba(255, 195, 95, 0.32), transparent 72%);
  filter: blur(10px);
}

.visual-copy {
  position: relative;
  z-index: 1;
}

.visual-copy p {
  margin: 0 0 8px;
  color: rgba(255, 255, 255, 0.74);
}

.visual-copy strong {
  font-family: "Oxanium", sans-serif;
  font-size: clamp(1.7rem, 3vw, 2.6rem);
  line-height: 1.1;
}

.visual-badge {
  position: relative;
  z-index: 1;
  align-self: flex-start;
  padding: 12px 16px;
  border-radius: 999px;
  color: var(--warning);
  font-size: 0.8rem;
}

.quiz-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 24px;
  margin-bottom: 20px;
}

.progress-copy {
  flex: 1;
}

.progress-label {
  display: inline-block;
  margin-bottom: 12px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.88rem;
}

.progress-track {
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.06);
}

.progress-bar {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #ffb15f);
  transition: width 380ms ease;
}

.scoreboard {
  display: flex;
  align-items: center;
  gap: 16px;
}

.score-chip {
  min-width: 118px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  text-align: center;
}

.chip-label {
  display: block;
  margin-bottom: 8px;
  color: var(--text-muted);
  font-size: 0.76rem;
}

.score-chip strong {
  font-size: 1.7rem;
}

.timer-ring-wrap {
  position: relative;
  width: 112px;
  height: 112px;
  display: grid;
  place-items: center;
}

.timer-svg {
  width: 112px;
  height: 112px;
  transform: rotate(-90deg);
}

.timer-track,
.timer-progress {
  fill: none;
  stroke-width: 7;
}

.timer-track {
  stroke: rgba(255, 255, 255, 0.08);
}

.timer-progress {
  stroke: var(--accent);
  stroke-linecap: round;
  transition: stroke-dashoffset 950ms linear, stroke 180ms ease;
  filter: drop-shadow(0 0 10px rgba(255, 106, 61, 0.28));
}

.timer-copy {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  text-align: center;
  line-height: 1;
}

.timer-copy span {
  font-family: "Oxanium", sans-serif;
  font-size: 2rem;
  font-weight: 800;
}

.timer-copy small {
  margin-top: -8px;
  color: var(--text-muted);
}

.question-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.92fr);
  min-height: 620px;
  overflow: hidden;
}

.question-card--no-media {
  grid-template-columns: 1fr;
  min-height: auto;
}

.question-card.is-entering {
  animation: questionSlide 520ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.question-card.is-pulse {
  animation: cardPulse 520ms ease;
}

.question-card.is-shake {
  animation: cardShake 440ms ease;
}

.question-media {
  position: relative;
  min-height: 100%;
}

.question-media::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 38%;
  background: linear-gradient(180deg, transparent, rgba(5, 9, 15, 0.78));
}

.question-media img {
  width: 100%;
  height: 100%;
  min-height: 620px;
  object-fit: cover;
  transform: scale(1.03);
  animation: cinematicZoom 9s ease-in-out infinite alternate;
}

.question-copy {
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 34px 34px 30px;
}

.question-category {
  display: inline-flex;
  align-self: flex-start;
  padding: 10px 14px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: #ffd7ca;
  font-size: 0.78rem;
}

.question-title {
  margin: 0;
  font-family: "Oxanium", sans-serif;
  font-size: clamp(1.75rem, 2.7vw, 2.45rem);
  line-height: 1.08;
}

.answers-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.answer-button {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  width: 100%;
  min-height: 84px;
  padding: 18px;
  text-align: left;
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 22px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
  animation: riseIn 420ms ease both;
  animation-delay: calc(var(--stagger, 1) * 70ms);
}

.answer-button:hover:not(:disabled) {
  transform: translateY(-3px);
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.05);
}

.answer-button:disabled {
  cursor: default;
}

.answer-index {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  font-family: "Oxanium", sans-serif;
  font-size: 0.88rem;
}

.answer-text {
  flex: 1;
  line-height: 1.55;
}

.answer-button.is-correct {
  border-color: rgba(98, 240, 178, 0.72);
  background: rgba(98, 240, 178, 0.16);
  box-shadow: 0 18px 32px rgba(27, 127, 87, 0.2);
}

.answer-button.is-wrong {
  border-color: rgba(255, 108, 136, 0.7);
  background: rgba(255, 108, 136, 0.14);
}

.fact-panel {
  min-height: 100px;
  padding: 18px 20px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid transparent;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 260ms ease, transform 260ms ease, border-color 260ms ease;
}

.fact-panel.is-visible {
  opacity: 1;
  transform: translateY(0);
  border-color: rgba(255, 255, 255, 0.08);
}

.fact-label {
  margin: 0 0 10px;
  color: var(--warning);
  font-size: 0.82rem;
}

.fact-panel p:last-child {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.65;
}

.question-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: auto;
}

.helper-text {
  color: var(--text-muted);
  font-size: 0.96rem;
}

.scene--result {
  justify-items: center;
}

.result-card {
  width: min(760px, 100%);
  padding: 48px;
  text-align: center;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0)),
    linear-gradient(180deg, rgba(255, 106, 61, 0.08), transparent 40%),
    var(--panel);
}

.result-rank {
  margin: 10px 0 18px;
  font-family: "Oxanium", sans-serif;
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1.05;
}

.result-score-line {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 12px;
  margin-bottom: 16px;
}

.result-score-value {
  font-family: "Oxanium", sans-serif;
  font-size: clamp(3rem, 10vw, 5.5rem);
  font-weight: 800;
  line-height: 0.9;
}

.result-score-unit {
  color: var(--text-muted);
  font-size: 1.1rem;
}

.result-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 30px 0 34px;
}

.result-metric {
  padding: 18px 20px;
  border-radius: var(--radius-lg);
}

.result-metric strong {
  display: block;
  margin-top: 10px;
  font-size: 1.3rem;
}

.metric-label {
  color: var(--text-muted);
  font-size: 0.76rem;
}

@keyframes riseIn {
  from {
    opacity: 0;
    transform: translateY(14px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes questionSlide {
  from {
    opacity: 0;
    transform: translateX(22px) scale(0.985);
  }

  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

@keyframes cinematicZoom {
  from {
    transform: scale(1.02);
  }

  to {
    transform: scale(1.09);
  }
}

@keyframes cardPulse {
  0% {
    transform: scale(1);
    box-shadow: var(--shadow-heavy);
  }

  50% {
    transform: scale(1.01);
    box-shadow: 0 26px 84px rgba(16, 194, 122, 0.16);
  }

  100% {
    transform: scale(1);
    box-shadow: var(--shadow-heavy);
  }
}

@keyframes cardShake {
  0%,
  100% {
    transform: translateX(0);
  }

  20% {
    transform: translateX(-8px);
  }

  40% {
    transform: translateX(7px);
  }

  60% {
    transform: translateX(-4px);
  }

  80% {
    transform: translateX(3px);
  }
}

@media (max-width: 1060px) {
  .scene--start {
    grid-template-columns: 1fr;
  }

  .hero-visual {
    min-height: 380px;
  }

  .question-card {
    grid-template-columns: 1fr;
  }

  .question-media img {
    min-height: 280px;
    max-height: 340px;
  }
}

@media (max-width: 768px) {
  .app-shell {
    width: min(100% - 20px, 1180px);
    margin: 10px auto;
  }

  .scene {
    min-height: calc(100vh - 20px);
  }

  .hero-copy,
  .result-card {
    padding: 28px;
  }

  .quiz-topbar {
    flex-direction: column;
    align-items: stretch;
  }

  .scoreboard {
    justify-content: space-between;
  }

  .timer-ring-wrap,
  .timer-svg {
    width: 96px;
    height: 96px;
  }

  .answers-grid,
  .result-metrics {
    grid-template-columns: 1fr;
  }

  .question-copy {
    padding: 24px 20px 22px;
  }

  .question-footer {
    flex-direction: column;
    align-items: stretch;
  }
}

@media (max-width: 560px) {
  .hero-copy h1 {
    font-size: 2.5rem;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .primary-button,
  .secondary-button {
    width: 100%;
  }

  .scoreboard {
    gap: 12px;
  }

  .score-chip {
    flex: 1;
  }

  .question-title {
    font-size: 1.6rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
