:root {
  --bg: #f2f9ff;
  --card: #ffffff;
  --text: #1f2d3d;
  --accent: #2f80ed;
  --ok: #1f9d55;
  --bad: #d64545;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Nunito", "Segoe UI", sans-serif;
  background: linear-gradient(180deg, #dbf0ff 0%, #f7fcff 100%);
  color: var(--text);
}

.app {
  max-width: 720px;
  margin: 24px auto;
  padding: 12px;
  display: grid;
  gap: 12px;
}

.card {
  background: var(--card);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 8px 24px rgba(20, 60, 110, 0.08);
}

.header h1 { margin: 0; }
.header p { margin: 8px 0 0; }

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  text-align: center;
}

.controls {
  display: grid;
  gap: 8px;
}

.timerRow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

select, input, button {
  border: 1px solid #d4dff0;
  border-radius: 12px;
  padding: 12px;
  font-size: 16px;
}

button {
  border: none;
  background: var(--accent);
  color: white;
  font-weight: 700;
  cursor: pointer;
}

button:hover { opacity: 0.9; }

.quiz h2 {
  text-align: center;
  font-size: 32px;
  margin: 8px 0 16px;
}

#answerForm {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

#feedback { min-height: 24px; font-weight: 700; }
.ok { color: var(--ok); }
.bad { color: var(--bad); }

.history ul,
#historyList {
  margin: 0;
  padding-left: 20px;
}

#historyList li {
  margin-bottom: 6px;
}

.danger { background: #ef4444; }

@media (max-width: 560px) {
  .stats { grid-template-columns: 1fr; }
  .quiz h2 { font-size: 28px; }
}
