:root {
  --ink: #17211c;
  --muted: #647067;
  --panel: rgba(255, 252, 241, 0.88);
  --line: rgba(23, 33, 28, 0.14);
  --fern: #1f7a4d;
  --fern-dark: #125236;
  --sun: #f0b43c;
  --clay: #c85e3b;
  --mint: #dff5df;
  --bad: #b7362e;
  --good: #167a4a;
  --shadow: 0 24px 70px rgba(40, 52, 43, 0.18);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Segoe UI", Tahoma, sans-serif;
  background:
    radial-gradient(
      circle at 10% 10%,
      rgba(240, 180, 60, 0.34),
      transparent 28rem
    ),
    radial-gradient(
      circle at 90% 12%,
      rgba(31, 122, 77, 0.22),
      transparent 24rem
    ),
    linear-gradient(135deg, #f7edd0 0%, #e8f3dc 52%, #f8dfc5 100%);
  overflow-x: hidden;
}
body:before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(23, 33, 28, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23, 33, 28, 0.05) 1px, transparent 1px);
  background-size: 38px 38px;
  mask-image: linear-gradient(to bottom, #000, transparent 85%);
}
.orb {
  position: fixed;
  border-radius: 999px;
  filter: blur(4px);
  opacity: 0.5;
  animation: float 8s ease-in-out infinite;
  pointer-events: none;
}
.orb-one {
  width: 180px;
  height: 180px;
  background: var(--sun);
  right: -40px;
  top: 220px;
}
.orb-two {
  width: 110px;
  height: 110px;
  background: var(--fern);
  left: -25px;
  bottom: 80px;
  animation-delay: -3s;
}
@keyframes float {
  50% {
    transform: translateY(-22px) rotate(8deg);
  }
}
.app-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 34px 0;
  position: relative;
}
.hero {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 24px;
  align-items: stretch;
  margin-bottom: 22px;
}
.eyebrow {
  margin: 0 0 12px;
  color: var(--fern-dark);
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
h1 {
  margin: 0;
  max-width: 760px;
  font-family: "Segoe UI", Tahoma, sans-serif;
  font-size: clamp(2rem, 3.8vw, 3.8rem);
  line-height: 1.08;
  letter-spacing: -0.04em;
  font-weight: 800;
}
.hero-copy {
  max-width: 680px;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.7;
}
.score-card,
.sidebar,
.quiz-panel,
.toolbar {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}
.score-card {
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.score-card span {
  color: var(--muted);
  font-weight: 700;
}
.score-card strong {
  font-family: "Segoe UI", Tahoma, sans-serif;
  font-size: 3.1rem;
  color: var(--fern-dark);
}
.score-card p {
  margin: 0;
  color: var(--muted);
}
.toolbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px;
  margin-bottom: 18px;
}
.mode-tabs,
.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
button {
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  color: #fff;
  background: var(--fern);
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease;
}
button:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(31, 122, 77, 0.22);
}
button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
button.ghost,
.mode-tabs button {
  background: #fff7df;
  color: var(--ink);
  border: 1px solid var(--line);
}
.mode-tabs button.active {
  background: var(--ink);
  color: #fff;
}
button.danger {
  background: var(--clay);
}
.layout {
  display: grid;
  grid-template-columns: 330px 1fr;
  gap: 18px;
}
.sidebar {
  padding: 18px;
  align-self: start;
}
.sidebar-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.sidebar h2 {
  margin: 0;
  font-family: "Segoe UI", Tahoma, sans-serif;
  font-size: 1.45rem;
}
.sidebar-title span {
  color: var(--muted);
  font-weight: 700;
}
.topic-list {
  display: grid;
  gap: 10px;
}
.topic-item {
  width: 100%;
  text-align: left;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.54);
  color: var(--ink);
  border: 1px solid var(--line);
  padding: 14px;
}
.topic-item.active {
  background: var(--fern-dark);
  color: #fff;
}
.topic-item small {
  display: block;
  margin-top: 6px;
  opacity: 0.75;
}
.quiz-panel {
  padding: 22px;
  min-height: 560px;
}
.question-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-weight: 800;
  margin-bottom: 12px;
}
.progress-track {
  height: 12px;
  border-radius: 999px;
  background: rgba(23, 33, 28, 0.1);
  overflow: hidden;
  margin-bottom: 20px;
}
#progressBar {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--fern), var(--sun));
  transition: width 0.25s ease;
}
.question-card {
  background: rgba(255, 255, 255, 0.42);
  border: 1px solid var(--line);
  border-radius: 26px;
  padding: 24px;
  animation: rise 0.35s ease both;
}
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
}
.question-card h2 {
  margin: 0 0 20px;
  font-size: clamp(1.15rem, 1.6vw, 1.45rem);
  line-height: 1.45;
}
.answers {
  display: grid;
  gap: 12px;
}
.answer {
  width: 100%;
  text-align: left;
  border-radius: 18px;
  padding: 15px 16px;
  background: #fffaf0;
  color: var(--ink);
  border: 2px solid transparent;
  display: grid;
  grid-template-columns: 34px 1fr;
  align-items: start;
  gap: 10px;
}
.answer .letter {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(31, 122, 77, 0.12);
  font-weight: 900;
}
.answer.correct {
  border-color: var(--good);
  background: var(--mint);
}
.answer.wrong {
  border-color: var(--bad);
  background: #ffe4de;
}
.feedback {
  margin-top: 18px;
  padding: 16px;
  border-radius: 18px;
  line-height: 1.65;
  border: 1px solid var(--line);
  background: #fff7dd;
}
.feedback.good {
  border-color: rgba(22, 122, 74, 0.35);
}
.feedback.bad {
  border-color: rgba(183, 54, 46, 0.35);
}
.hidden {
  display: none;
}
.quiz-nav {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
}
@media (max-width: 860px) {
  .hero,
  .layout {
    grid-template-columns: 1fr;
  }
  .toolbar {
    align-items: stretch;
    flex-direction: column;
  }
  .mode-tabs button,
  .actions button {
    flex: 1;
  }
  .quiz-panel {
    min-height: auto;
  }
}
@media (max-width: 520px) {
  .app-shell {
    width: min(100% - 20px, 1180px);
    padding: 18px 0;
  }
  .question-card,
  .quiz-panel,
  .sidebar {
    padding: 16px;
    border-radius: 22px;
  }
  .quiz-nav {
    flex-direction: column;
  }
  .quiz-nav button {
    width: 100%;
  }
}
