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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #0d1b2a;
  color: #e0e0e0;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

.container {
  background: #1b2838;
  border-radius: 12px;
  padding: 2rem;
  max-width: 640px;
  width: 90%;
  box-shadow: 0 4px 24px rgba(0,0,0,.4);
}

h1 { color: #ff9900; margin-bottom: 1rem; font-size: 1.5rem; }
h2 { margin-bottom: 1.2rem; font-size: 1.15rem; line-height: 1.5; }

#quiz-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.settings-link {
  color: #ff9900;
  text-decoration: none;
  font-size: 1.1rem;
}

/* Progress */
#progress-bar-container {
  background: #2a3a4a;
  border-radius: 6px;
  height: 8px;
  margin-bottom: 1rem;
  overflow: hidden;
}
#progress-bar {
  background: #ff9900;
  height: 100%;
  width: 0%;
  transition: width .3s ease;
}

#question-counter { font-size: .85rem; color: #8899aa; margin-bottom: .5rem; }

/* Choices */
#choices { display: flex; flex-direction: column; gap: .6rem; margin-bottom: 1.2rem; }

.choice-btn {
  background: #243447;
  border: 2px solid #3a4f63;
  border-radius: 8px;
  padding: .75rem 1rem;
  color: #e0e0e0;
  font-size: .95rem;
  cursor: pointer;
  text-align: left;
  transition: background .2s, border-color .2s;
}
.choice-btn:hover { background: #2e4a5f; border-color: #ff9900; }
.choice-btn.selected { background: #2e4a5f; border-color: #ff9900; }
.choice-btn.correct { background: #1a4d2e; border-color: #2ecc71; }
.choice-btn.wrong { background: #4d1a1a; border-color: #e74c3c; }
.choice-btn:disabled { cursor: default; }

/* Buttons */
.btn {
  display: inline-block;
  padding: .65rem 1.5rem;
  border: 2px solid #3a4f63;
  border-radius: 8px;
  background: #243447;
  color: #e0e0e0;
  font-size: .95rem;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
}
.btn:hover { border-color: #ff9900; }
.btn:disabled { opacity: .4; cursor: default; }
.btn-primary { background: #ff9900; color: #0d1b2a; border-color: #ff9900; font-weight: 600; }
.btn-primary:hover { background: #e68a00; }
.btn-danger { background: #4d1a1a; border-color: #e74c3c; color: #e74c3c; }
.btn-danger:hover { background: #6b2222; border-color: #ff5555; }

.quiz-actions { display: flex; justify-content: space-between; }

.btn-group { display: flex; gap: 1rem; margin-top: 1.2rem; }

/* Score */
#score-circle {
  width: 140px; height: 140px;
  border-radius: 50%;
  border: 6px solid #ff9900;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 1.5rem auto;
}
#score-percent { font-size: 2rem; font-weight: 700; color: #ff9900; }
#score-detail { text-align: center; margin-bottom: 1.2rem; color: #8899aa; }
#result-screen .btn { display: block; margin: 0 auto; }

/* Settings */
label { display: block; margin-bottom: .4rem; font-weight: 600; }
input[type="number"] {
  width: 100%;
  padding: .6rem;
  border-radius: 8px;
  border: 2px solid #3a4f63;
  background: #243447;
  color: #e0e0e0;
  font-size: 1rem;
}
.hint { font-size: .8rem; color: #8899aa; margin-top: .3rem; }

.topic-fieldset {
  border: 2px solid #3a4f63;
  border-radius: 8px;
  padding: 1rem;
  margin-top: 1.2rem;
}
.topic-fieldset legend { color: #ff9900; font-weight: 600; padding: 0 .4rem; }
.topic-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem .8rem; margin-top: .5rem; }
.topic-label { display: flex; align-items: center; gap: .4rem; cursor: pointer; font-size: .95rem; }
.topic-label input[type="checkbox"] { accent-color: #ff9900; width: 16px; height: 16px; }
#save-confirmation { margin-top: 1rem; color: #2ecc71; font-weight: 600; }

.hidden { display: none; }
