:root {
  --bg: #120f0d;
  --bg-soft: #1b1612;
  --card: rgba(28, 20, 16, 0.84);
  --card-strong: rgba(40, 28, 21, 0.96);
  --ink: #f8eddc;
  --muted: #d5c2a6;
  --accent: #d8a23b;
  --accent-strong: #f4c463;
  --accent-dark: #8f5d17;
  --success: #9dd38a;
  --danger: #ff8f80;
  --border: rgba(244, 196, 99, 0.2);
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Manrope", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(216, 162, 59, 0.2), transparent 28%),
    radial-gradient(circle at right, rgba(150, 55, 28, 0.28), transparent 30%),
    linear-gradient(135deg, #0d0a08 0%, #17110e 50%, #0b0807 100%);
}

button {
  font: inherit;
}

.page-shell {
  position: relative;
  overflow: hidden;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 18px;
}

.glow {
  position: absolute;
  width: 22rem;
  height: 22rem;
  border-radius: 50%;
  filter: blur(22px);
  opacity: 0.22;
  pointer-events: none;
}

.glow-left {
  left: -6rem;
  top: 6rem;
  background: #9c2d12;
}

.glow-right {
  right: -6rem;
  bottom: 5rem;
  background: #d8a23b;
}

.app-card {
  width: min(100%, 980px);
  padding: clamp(22px, 4vw, 42px);
  border: 1px solid var(--border);
  border-radius: 30px;
  background:
    linear-gradient(180deg, rgba(244, 196, 99, 0.08), transparent 18%),
    var(--card);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.hero {
  margin-bottom: 24px;
}

.hidden-during-quiz.is-hidden {
  display: none;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent-strong);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.76rem;
  font-weight: 800;
}

h1,
h2 {
  margin: 0;
  font-family: "Cinzel", serif;
  line-height: 1.05;
}

h1 {
  font-size: clamp(2.5rem, 7vw, 5rem);
  letter-spacing: 0.02em;
}

.hero-copy {
  max-width: 62ch;
  margin: 14px 0 0;
  font-size: 1.02rem;
  line-height: 1.7;
  color: var(--muted);
}

.start-card {
  position: relative;
  margin-bottom: 26px;
  padding: clamp(18px, 3vw, 26px);
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(244, 196, 99, 0.06), rgba(255, 248, 235, 0.03)),
    rgba(255, 248, 235, 0.04);
  border: 1px solid rgba(255, 233, 187, 0.08);
  overflow: hidden;
}

.start-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at top, rgba(255, 215, 140, 0.14), transparent 28%),
    linear-gradient(90deg, transparent, rgba(255, 232, 188, 0.04), transparent);
  pointer-events: none;
}

.start-ornament {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.ornament-line {
  height: 1px;
  flex: 1;
  background: linear-gradient(90deg, transparent, rgba(244, 196, 99, 0.55), transparent);
}

.ornament-emblem {
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid rgba(244, 196, 99, 0.24);
  background: rgba(216, 162, 59, 0.08);
  color: var(--accent-strong);
  font-family: "Cinzel", serif;
  font-weight: 800;
  letter-spacing: 0.18em;
  font-size: 0.8rem;
  box-shadow: 0 0 24px rgba(216, 162, 59, 0.12);
}

.start-copy {
  position: relative;
  z-index: 1;
  margin: 0 0 18px;
  color: var(--muted);
  line-height: 1.65;
}

.stats-panel {
  position: relative;
  z-index: 1;
  margin-bottom: 18px;
  padding: 16px 18px 18px;
  border-radius: 22px;
  background: rgba(255, 248, 235, 0.04);
  border: 1px solid rgba(255, 241, 212, 0.08);
}

.stats-heading {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.stats-kicker {
  margin: 0 0 4px;
  color: rgba(248, 237, 220, 0.62);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.stats-title {
  font-size: clamp(1.15rem, 2vw, 1.45rem);
}

.stats-summary {
  max-width: 28ch;
  margin: 0;
  color: var(--muted);
  text-align: right;
  line-height: 1.55;
}

.set-toggle {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  width: 100%;
  margin-bottom: 14px;
}

.set-button {
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(255, 241, 212, 0.1);
  background: rgba(255, 248, 235, 0.03);
  color: var(--ink);
  font-weight: 800;
  text-align: center;
  cursor: pointer;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background 180ms ease,
    opacity 180ms ease;
}

.set-button:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: rgba(244, 196, 99, 0.34);
}

.set-button.active {
  background: linear-gradient(180deg, rgba(216, 162, 59, 0.22), rgba(255, 248, 235, 0.06));
  border-color: rgba(244, 196, 99, 0.42);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.16);
}

.set-button:disabled {
  opacity: 0.46;
  cursor: default;
}

.stats-hint {
  margin: 0 0 14px;
  color: var(--muted);
  line-height: 1.6;
}

.stats-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.stats-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(18, 14, 12, 0.3);
  border: 1px solid rgba(255, 241, 212, 0.07);
}

.stats-item-question {
  font-family: "Atkinson Hyperlegible", "Manrope", sans-serif;
  font-weight: 700;
  line-height: 1.45;
}

.stats-item-meta {
  color: var(--accent-strong);
  font-size: 0.84rem;
  font-weight: 800;
  white-space: nowrap;
}

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

.mode-button {
  position: relative;
  overflow: hidden;
  padding: 20px;
  border-radius: 22px;
  border: 1px solid rgba(255, 241, 212, 0.1);
  background:
    linear-gradient(180deg, rgba(255, 248, 235, 0.05), rgba(255, 248, 235, 0.02)),
    rgba(255, 248, 235, 0.03);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease,
    background 180ms ease;
}

.mode-button:hover {
  transform: translateY(-4px) scale(1.01);
  border-color: rgba(244, 196, 99, 0.4);
  box-shadow: 0 20px 38px rgba(0, 0, 0, 0.22);
}

.mode-button::before {
  content: "";
  position: absolute;
  inset: -20% auto auto -30%;
  width: 56%;
  height: 160%;
  transform: rotate(18deg);
  background: linear-gradient(90deg, transparent, rgba(255, 243, 215, 0.12), transparent);
  transition: transform 320ms ease;
}

.mode-button:hover::before {
  transform: translateX(32%) rotate(18deg);
}

.mode-button-primary {
  background: linear-gradient(180deg, rgba(216, 162, 59, 0.16), rgba(255, 248, 235, 0.04));
}

.mode-button-arena {
  box-shadow: inset 0 0 0 1px rgba(163, 59, 28, 0.14);
}

.mode-button-scroll {
  box-shadow: inset 0 0 0 1px rgba(244, 196, 99, 0.08);
}

.mode-frame,
.mode-title,
.mode-copy,
.mode-footer {
  position: relative;
  z-index: 1;
}

.mode-frame {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.mode-icon {
  display: inline-grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: rgba(255, 248, 235, 0.08);
  border: 1px solid rgba(255, 241, 212, 0.12);
  font-family: "Cinzel", serif;
  font-size: 1.3rem;
  color: var(--accent-strong);
  animation: float-emblem 4.8s ease-in-out infinite;
}

.mode-chip {
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(255, 248, 235, 0.07);
  border: 1px solid rgba(255, 241, 212, 0.12);
  color: rgba(248, 237, 220, 0.76);
  font-size: 0.74rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 800;
}

.mode-title,
.mode-copy {
  display: block;
}

.mode-title {
  margin-bottom: 8px;
  font-weight: 800;
  font-size: 1.08rem;
}

.mode-copy {
  color: var(--muted);
  line-height: 1.55;
}

.mode-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.mode-footer span {
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(17, 12, 10, 0.34);
  border: 1px solid rgba(255, 241, 212, 0.09);
  color: rgba(248, 237, 220, 0.74);
  font-size: 0.74rem;
  font-weight: 700;
}

.status-bar {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.status-pill,
.result-stat {
  padding: 16px 18px;
  border-radius: 18px;
  background: rgba(255, 248, 235, 0.04);
  border: 1px solid rgba(255, 233, 187, 0.08);
}

.status-pill span,
.result-stat span {
  display: block;
  margin-bottom: 6px;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  color: rgba(248, 237, 220, 0.64);
}

.status-pill strong,
.result-stat strong {
  font-size: 1rem;
}

.progress-wrap {
  height: 12px;
  margin-bottom: 26px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.progress-bar {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #c37d26, #f4c463, #ffe7a7);
  transition: width 240ms ease;
}

.quiz-card,
.result-card {
  padding: clamp(18px, 3vw, 28px);
  border-radius: 26px;
  background: var(--card-strong);
  border: 1px solid rgba(255, 241, 212, 0.08);
}

.question-topline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.question-badge {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(216, 162, 59, 0.12);
  color: var(--accent-strong);
  font-weight: 800;
  letter-spacing: 0.04em;
}

.question-text {
  margin-bottom: 18px;
  font-family: "Atkinson Hyperlegible", "Manrope", sans-serif;
  font-size: clamp(1.14rem, 2.45vw, 1.72rem);
  font-weight: 700;
  line-height: 1.38;
  letter-spacing: 0.01em;
  text-wrap: balance;
}

.options-grid {
  display: grid;
  gap: 12px;
}

.reveal-answer {
  margin-top: 8px;
  padding: 18px 20px;
  border-radius: 20px;
  background: rgba(216, 162, 59, 0.08);
  border: 1px solid rgba(244, 196, 99, 0.18);
}

.reveal-label {
  display: inline-block;
  margin-bottom: 8px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-strong);
}

.reveal-answer-text {
  margin: 0;
  font-size: 1.04rem;
  line-height: 1.7;
  color: var(--ink);
}

.option-button {
  position: relative;
  width: 100%;
  padding: 16px 18px 16px 54px;
  border: 1px solid rgba(255, 241, 212, 0.08);
  border-radius: 18px;
  background: rgba(255, 248, 235, 0.03);
  color: var(--ink);
  text-align: left;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background 180ms ease,
    box-shadow 180ms ease;
  cursor: pointer;
}

.option-button::before {
  content: attr(data-letter);
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 800;
  color: var(--accent-strong);
  border: 1px solid rgba(244, 196, 99, 0.25);
}

.option-button:hover:not(:disabled) {
  transform: translateY(-2px);
  border-color: rgba(244, 196, 99, 0.46);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.18);
}

.option-button.correct {
  background: rgba(157, 211, 138, 0.12);
  border-color: rgba(157, 211, 138, 0.68);
  box-shadow: 0 0 0 1px rgba(157, 211, 138, 0.2), 0 14px 28px rgba(97, 166, 78, 0.18);
}

.option-button.wrong {
  background: rgba(255, 143, 128, 0.12);
  border-color: rgba(255, 143, 128, 0.7);
  box-shadow: 0 0 0 1px rgba(255, 143, 128, 0.15);
}

.option-button.celebrate {
  animation: correct-bounce 520ms cubic-bezier(0.22, 1, 0.36, 1);
}

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

.answer-panel {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-top: 18px;
}

.feedback-card {
  position: relative;
  flex: 1;
  min-height: 96px;
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid rgba(255, 241, 212, 0.1);
  background: rgba(255, 248, 235, 0.05);
  overflow: hidden;
}

.feedback-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent, rgba(255, 255, 255, 0.08), transparent);
  transform: translateX(-120%);
}

.feedback-card.success {
  border-color: rgba(157, 211, 138, 0.5);
  background: linear-gradient(180deg, rgba(157, 211, 138, 0.18), rgba(255, 248, 235, 0.04));
  box-shadow: 0 18px 34px rgba(63, 113, 42, 0.16);
  animation: feedback-pop 420ms ease-out;
}

.feedback-card.success::after {
  animation: feedback-shine 740ms ease-out;
}

.feedback-card.error {
  border-color: rgba(255, 143, 128, 0.55);
  background: linear-gradient(180deg, rgba(255, 143, 128, 0.16), rgba(255, 248, 235, 0.04));
  box-shadow: 0 18px 34px rgba(118, 51, 39, 0.16);
  animation: feedback-pop 420ms ease-out;
}

.feedback-label {
  display: inline-block;
  margin-bottom: 8px;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.feedback-text {
  margin: 0;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.55;
}

.feedback-answer {
  margin: 10px 0 0;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(18, 14, 12, 0.36);
  border: 1px solid rgba(255, 241, 212, 0.08);
  color: #fff1cd;
  font-size: 1.02rem;
  font-weight: 800;
  line-height: 1.55;
}

.feedback-card.success .feedback-label {
  color: #d8ffd1;
}

.feedback-card.error .feedback-label {
  color: #ffd0c9;
}

.controls {
  flex-shrink: 0;
}

.primary-button,
.ghost-button {
  border: 0;
  border-radius: 999px;
  padding: 13px 22px;
  font-weight: 800;
  letter-spacing: 0.02em;
  cursor: pointer;
}

.primary-button {
  color: #20150d;
  background: linear-gradient(135deg, #d59836, #ffd98a);
  box-shadow: 0 14px 26px rgba(213, 152, 54, 0.25);
}

.ghost-button {
  color: var(--ink);
  background: rgba(255, 248, 235, 0.06);
  border: 1px solid rgba(255, 241, 212, 0.1);
}

.primary-button:disabled {
  opacity: 0.45;
  cursor: default;
}

.result-card {
  text-align: center;
}

.result-summary {
  max-width: 45ch;
  margin: 14px auto 24px;
  color: var(--muted);
  line-height: 1.7;
}

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

.result-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
}

@keyframes correct-bounce {
  0% {
    transform: scale(1);
  }

  35% {
    transform: scale(1.03);
  }

  65% {
    transform: scale(0.985);
  }

  100% {
    transform: scale(1);
  }
}

@keyframes feedback-pop {
  0% {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }

  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes feedback-shine {
  0% {
    transform: translateX(-120%);
  }

  100% {
    transform: translateX(130%);
  }
}

@keyframes float-emblem {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-4px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .mode-button,
  .mode-button::before,
  .mode-icon,
  .feedback-card,
  .feedback-card::after,
  .progress-bar,
  .option-button {
    transition: none;
    animation: none;
  }
}

.hidden {
  display: none;
}

@media (max-width: 720px) {
  .set-toggle,
  .mode-grid,
  .status-bar,
  .result-stats {
    grid-template-columns: 1fr;
  }

  .stats-heading,
  .question-topline,
  .answer-panel,
  .result-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .stats-summary {
    max-width: none;
    text-align: left;
  }

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

  .option-button {
    padding-left: 48px;
  }

  .start-ornament,
  .mode-frame {
    align-items: flex-start;
  }
}
