#root {
  max-width: 640px;
  width: 100%;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* --- start screen --- */
.start-screen {
  padding: 32px 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.start-screen .start-heading {
  font-size: 1.4rem;
  font-weight: 700;
  margin: 0;
}

.start-screen p {
  color: var(--muted);
  line-height: 1.5;
  margin: 0;
}

.variant-choice {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.variant-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--btn-bg);
  cursor: pointer;
}

.variant-option input {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.variant-option.selected {
  border-color: var(--accent);
}

.variant-option .variant-title {
  font-weight: 600;
}

.variant-option .variant-sub {
  font-size: 0.85rem;
  color: var(--muted);
}

.start-btn {
  display: block;
  width: 100%;
  padding: 16px;
  font-size: 1.05rem;
  font-weight: 700;
  border-radius: 12px;
  border: none;
  background: var(--accent);
  color: #fff;
  font-family: inherit;
  cursor: pointer;
}

/* --- top bar during test --- */
.test-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}

.test-progress {
  color: var(--muted);
}

.test-timer {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.test-timer.low {
  color: var(--wrong);
}

/* --- overview grid --- */
.overview-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  padding: 12px 16px;
}

.overview-cell {
  aspect-ratio: 1;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--btn-bg);
  color: var(--fg);
  font-family: inherit;
  font-size: 0.85rem;
  cursor: pointer;
}

.overview-cell.answered {
  background: var(--correct-bg);
  border-color: var(--correct);
  color: var(--correct);
}

.overview-cell.current {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.overview-toggle {
  margin: 8px 16px 0 16px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--fg);
  font-family: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  text-align: center;
}

/* --- nav row (prev/next/submit) --- */
.test-nav {
  display: flex;
  gap: 10px;
  padding: 8px 16px 16px 16px;
}

.nav-btn {
  flex: 1;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--btn-bg);
  color: var(--fg);
  font-family: inherit;
  font-size: 0.95rem;
  cursor: pointer;
}

.nav-btn:disabled {
  opacity: 0.4;
}

.answer-btn.selected {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 15%, var(--btn-bg));
  color: var(--fg);
  font-weight: 600;
}

.nav-btn.submit {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 700;
}

/* --- results screen --- */
.results-screen {
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.result-headline {
  text-align: center;
  padding: 20px;
  border-radius: 16px;
  border: 1px solid var(--border);
}

.result-headline.pass {
  border-color: var(--correct);
  background: var(--correct-bg);
}

.result-headline.fail {
  border-color: var(--wrong);
  background: var(--wrong-bg);
}

.result-headline .big-score {
  font-size: 2.2rem;
  font-weight: 800;
}

.result-headline.pass .big-score { color: var(--correct); }
.result-headline.fail .big-score { color: var(--wrong); }

.result-headline .verdict {
  font-weight: 700;
  margin-top: 4px;
}

.category-breakdown {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.category-row .cat-label-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  margin-bottom: 4px;
}

.category-row .cat-bar-track {
  height: 10px;
  border-radius: 5px;
  background: var(--btn-bg);
  overflow: hidden;
}

.category-row .cat-bar-fill {
  height: 100%;
  background: var(--accent);
}

.review-btn {
  display: block;
  width: 100%;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--btn-bg);
  color: var(--fg);
  font-family: inherit;
  font-size: 0.95rem;
  cursor: pointer;
  text-align: center;
}

.restart-btn {
  display: block;
  width: 100%;
  padding: 14px;
  border-radius: 12px;
  border: none;
  background: var(--accent);
  color: #fff;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
}

/* --- review mode: scrollable list of every question, expand for detail --- */
.review-hint {
  color: var(--muted);
  font-size: 0.85rem;
  margin: 10px 16px;
}

.review-list {
  padding: 0 16px 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.review-item {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--btn-bg);
  overflow: hidden;
}

.review-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  cursor: pointer;
  list-style: none;
}

.review-summary::-webkit-details-marker {
  display: none;
}

.review-summary::after {
  content: "+";
  color: var(--muted);
  font-weight: 400;
  margin-left: auto;
  flex-shrink: 0;
}

.review-item[open] .review-summary::after {
  content: "–";
}

.review-status {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
}

.review-status.correct {
  background: var(--correct-bg);
  color: var(--correct);
}

.review-status.wrong {
  background: var(--wrong-bg);
  color: var(--wrong);
}

.review-status.unanswered {
  background: var(--border);
  color: var(--muted);
}

.review-num {
  flex-shrink: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.review-snippet {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.92rem;
}

.review-body {
  border-top: 1px solid var(--border);
}

.review-body .question-text {
  padding-top: 14px;
}

.answer-btn.your-pick::after {
  content: " (tvoje volba)";
  font-weight: 400;
  font-size: 0.85em;
}
