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

:root {
  --bg: #FAFAF8;
  --surface: #FFFFFF;
  --text: #1A1A18;
  --text-sec: #6B6B66;
  --border: #E8E8E4;
  --accent: #2B5CE6;
  --accent-light: #EEF2FD;
  --ok: #1A8754;
  --ok-bg: #EEFBF3;
  --ok-border: #B8E6CD;
  --err: #D93025;
  --err-bg: #FDF0EF;
  --err-border: #F5C6C2;
  --r: 12px;
  --font: 'DM Sans', sans-serif;
  --display: 'DM Serif Display', serif;
}

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
}

.quiz-root {
  font-family: var(--font);
  color: var(--text);
  min-height: 100vh;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 32px 20px 60px;
}

.quiz-box {
  width: 100%;
  max-width: 620px;
}

/* Progress */
.bar-wrap {
  width: 100%;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin-bottom: 36px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width .5s cubic-bezier(.4,0,.2,1);
}

/* Centered screens */
.centered {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  animation: up .45s ease both;
}

.tag {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-light);
  padding: 6px 14px;
  border-radius: 20px;
  margin-bottom: 24px;
}

h1 {
  font-family: var(--display);
  font-size: 34px;
  font-weight: 400;
  line-height: 1.2;
  margin-bottom: 24px;
}

.desc {
  font-size: 15px;
  line-height: 1.75;
  color: var(--text-sec);
  max-width: 500px;
  margin-bottom: 36px;
  white-space: pre-line;
  text-align: left;
}

.stage-num {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--accent-light);
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 20px;
}

.btn {
  font-family: var(--font);
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  border: none;
  padding: 14px 36px;
  border-radius: 50px;
  cursor: pointer;
  transition: all .2s ease;
  letter-spacing: .02em;
}

.btn:hover {
  background: #2350CC;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(43,92,230,.25);
}

.btn:active {
  transform: translateY(0);
}

/* Question */
.q-page {
  animation: up .35s ease both;
}

.q-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.q-counter {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-sec);
  letter-spacing: .04em;
}

.q-tag {
  font-size: 12px;
  color: var(--accent);
  background: var(--accent-light);
  padding: 3px 10px;
  border-radius: 12px;
  font-weight: 500;
}

.q-title {
  font-family: var(--display);
  font-size: 24px;
  font-weight: 400;
  line-height: 1.35;
  margin-bottom: 16px;
}

.q-pre {
  font-size: 15px;
  line-height: 1.75;
  margin-bottom: 28px;
  white-space: pre-line;
}

.opts {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
}

.opt {
  font-family: var(--font);
  display: flex;
  align-items: flex-start;
  gap: 14px;
  width: 100%;
  padding: 16px 20px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--r);
  cursor: pointer;
  transition: all .15s ease;
  text-align: left;
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
}

.opt:hover:not(.locked) {
  border-color: var(--accent);
  background: var(--accent-light);
}

.opt:hover:not(.locked) .ltr {
  background: var(--accent);
  color: #fff;
}

.ltr {
  min-width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-sec);
  flex-shrink: 0;
  margin-top: 1px;
  transition: all .15s ease;
}

.opt.ok { border-color: var(--ok-border); background: var(--ok-bg); }
.opt.ok .ltr { background: var(--ok); color: #fff; }
.opt.err { border-color: var(--err-border); background: var(--err-bg); }
.opt.err .ltr { background: var(--err); color: #fff; }
.opt.dim { opacity: .5; cursor: default; }
.opt .ico { margin-left: auto; font-size: 18px; flex-shrink: 0; margin-top: 2px; }

.expl {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 20px 24px;
  margin-bottom: 24px;
  animation: up .3s ease both;
}

.expl-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-sec);
  margin-bottom: 8px;
}

.expl p {
  font-size: 14px;
  line-height: 1.75;
}

.btn-next {
  font-family: var(--font);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  padding: 12px 28px;
  background: var(--text);
  color: #fff;
  border: none;
  border-radius: 50px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s ease;
}

.btn-next:hover {
  background: #333;
  transform: translateY(-1px);
}

/* Results */
.res-emoji { font-size: 64px; margin-bottom: 16px; }
.res-msg { font-size: 17px; color: var(--text-sec); margin-bottom: 32px; }

.score-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 28px;
  margin-bottom: 32px;
  box-shadow: 0 1px 3px rgba(0,0,0,.04), 0 4px 12px rgba(0,0,0,.03);
}

.score-big {
  font-family: var(--display);
  font-size: 56px;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 6px;
}

.score-sub {
  font-size: 14px;
  color: var(--text-sec);
}

.btn-again {
  font-family: var(--font);
  font-size: 15px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-light);
  border: none;
  padding: 14px 36px;
  border-radius: 50px;
  cursor: pointer;
  transition: all .2s ease;
}

.btn-again:hover {
  background: #DCE4FB;
}

@keyframes up {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}
