
:root {
  --accent-blue: #4a9eff;
  --accent-purple: #a78bfa;
  --text-soft: #888;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: linear-gradient(135deg, #f5f7fa 0%, #e8ecf1 100%);
  min-height: 100vh;
  padding: 20px;
}
.back-home {
  display: inline-block;
  margin-bottom: 1rem;
  color: var(--accent-blue);
  text-decoration: none;
  font-size: 0.95rem;
}
.back-home:hover { text-decoration: underline; }
.page-title {
  text-align: center;
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  color: #2d3748;
}
.page-title span { font-size: 1rem; color: var(--text-soft); display: block; margin-top: 4px; }
.quiz-container {
  display: flex;
  gap: 1.5rem;
  max-width: 1100px;
  margin: 0 auto;
}
.nav-panel {
  flex: 0 0 240px;
  background: #fff;
  border-radius: 1.2rem;
  padding: 1.2rem;
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  height: fit-content;
  position: sticky;
  top: 20px;
}
.nav-panel h3 { font-size: 1rem; color: var(--accent-purple); margin-bottom: 0.8rem; }
.btn-row { display: flex; gap: 0.5rem; margin-bottom: 0.8rem; }
.reset-btn, .speed-btn {
  flex: 1;
  background: var(--accent-blue);
  color: #fff;
  border: none;
  border-radius: 2rem;
  padding: 0.35rem 0;
  font-size: 0.88rem;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}
.reset-btn { background: #e0e0e0; color: #555; }
.reset-btn:hover { background: #ccc; }
.speed-btn:hover { background: var(--accent-purple); transform: scale(1.03); }
.ball-grid { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-top: 0.5rem; }
.ball {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: #eef0f3;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 600;
  color: #555;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 2px 4px rgba(0,0,0,0.08);
}
.ball:hover { transform: scale(1.1); box-shadow: 0 4px 8px rgba(0,0,0,0.15); }
.ball.answered-correct { background: #2ecc71; color: #fff; }
.ball.answered-wrong   { background: #e74c3c; color: #fff; }
.ball-hint { font-size: 0.75rem; color: var(--text-soft); margin-top: 0.8rem; }
.question-panel {
  flex: 1;
  background: #fff;
  border-radius: 1.2rem;
  padding: 2rem;
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}
.question-title { font-size: 1.1rem; color: #888; margin-bottom: 0.8rem; }
.question-text {
  font-size: 1.15rem;
  line-height: 1.8;
  color: #2d3748;
  margin-bottom: 1.2rem;
}
.option-item {
  padding: 0.85rem 1.2rem;
  margin: 0.45rem 0;
  border: 2px solid #e8ecf1;
  border-radius: 0.75rem;
  cursor: pointer;
  font-size: 1.05rem;
  color: #2d3748;
  transition: all 0.18s;
  background: #fafbfc;
}
.option-item:hover { border-color: var(--accent-blue); background: #f0f7ff; transform: translateY(-1px); }
.option-item.temp-selected { border-color: var(--accent-purple); background: #f5f3ff; }
.option-item.correct-answer { background: #d5f5e3; border-color: #2ecc71; }
.option-item.selected-wrong { background: #fadbd8; border-color: #e74c3c; }
.action-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1.5rem;
}
.action-bar button {
  background: var(--accent-blue);
  color: #fff;
  border: none;
  border-radius: 2rem;
  padding: 0.55rem 2.2rem;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}
.action-bar button:hover:not(:disabled) { background: var(--accent-purple); transform: scale(1.03); }
.action-bar button:disabled { background: #ccc; cursor: not-allowed; transform: none; }
.explanation {
  margin-top: 1.5rem;
  padding: 1.2rem 1.5rem;
  background: #f9f7ff;
  border-left: 5px solid var(--accent-purple);
  border-radius: 0 0.75rem 0.75rem 0;
  animation: fadeIn 0.3s ease;
}
@keyframes fadeIn { from { opacity:0; transform:translateY(-4px); } to { opacity:1; transform:none; } }
.explanation strong { color: var(--accent-purple); display: block; margin-bottom: 0.4rem; }
.explanation p { color: #444; line-height: 1.7; font-size: 1rem; }
.grid-container {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  max-width: 960px;
  margin: 0 auto;
}
.card {
  display: block;
  padding: 1.4rem 1.8rem;
  background: #fff;
  border-radius: 1rem;
  text-decoration: none;
  color: #2d3748;
  box-shadow: 0 2px 10px rgba(0,0,0,0.07);
  font-size: 1.05rem;
  font-weight: 600;
  transition: all 0.2s;
  text-align: center;
  min-width: 160px;
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(74,158,255,0.2);
  color: var(--accent-blue);
}

