body {
  font-family: Arial, sans-serif;
  background: #f2f2f2;
  margin: 0;
  padding: 16px;
}

.app {
  max-width: 600px;
  margin: 0 auto;
  background: white;
  padding: 18px;
  border-radius: 16px;
  box-sizing: border-box;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

h1, h2, h3, p {
  word-wrap: break-word;
}

p {
  line-height: 1.5;
}

.home-header {
  text-align: center;
  margin-bottom: 20px;
}

.app-title {
  font-size: 32px;
  margin: 0 0 8px 0;
}

.app-subtitle {
  margin: 0;
  color: #555;
  font-size: 16px;
}

.section-title {
  margin-top: 0;
  margin-bottom: 12px;
}

.passage-text {
  background: #f8f8f8;
  padding: 14px;
  border-radius: 12px;
  line-height: 1.7;
  color: #222;
}

.progress-text {
  color: #555;
  margin-top: 4px;
  font-size: 14px;
}

.progress-bar-container {
  width: 100%;
  height: 10px;
  background: #e5e5e5;
  border-radius: 999px;
  overflow: hidden;
  margin: 10px 0 16px 0;
}

.progress-bar-fill {
  height: 100%;
  background: #111;
  width: 0%;
  transition: width 0.3s ease;
}

.feedback-box {
  background: #f8f8f8;
  border-radius: 12px;
  padding: 14px;
  margin-top: 16px;
}

.feedback-label {
  font-weight: bold;
  margin-bottom: 6px;
}

.home-stats {
  background: #f8f8f8;
  border-radius: 12px;
  padding: 14px;
  margin-top: 18px;
}

.home-stats-title {
  margin: 0 0 6px 0;
  font-weight: bold;
}

.home-stats-text {
  margin: 0;
  color: #555;
  font-size: 14px;
}

.subject-page-header {
  margin-bottom: 18px;
  text-align: center;
}

.subject-page-subtitle {
  color: #666;
  font-size: 15px;
  margin-top: 6px;
  margin-bottom: 0;
}

.subject-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.subject-card {
  background: #ffffff;
  border: 1px solid #e9e9e9;
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.05);
  box-sizing: border-box;
}

.subject-card-top {
  margin-bottom: 14px;
}

.subject-card-title {
  font-size: 20px;
  font-weight: 700;
  color: #111;
  margin-bottom: 4px;
}

.subject-card-desc {
  font-size: 14px;
  color: #666;
  line-height: 1.4;
}

.subject-mode-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.answer-btn,
#start-btn,
.subject-btn,
#go-subjects-btn,
#back-home-btn,
#next-btn,
.mode-btn {
  display: block;
  width: 100%;
  padding: 14px 16px;
  margin-top: 12px;
  font-size: 16px;
  line-height: 1.35;
  border: none;
  border-radius: 12px;
  outline: none;
  box-sizing: border-box;
  transition: background-color 0.2s ease, transform 0.08s ease, box-shadow 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.answer-btn {
  text-align: left;
  background: #ececec;
  color: #111;
}

.subject-btn,
#go-subjects-btn,
#back-home-btn,
#next-btn,
#start-btn,
.standard-btn {
  text-align: center;
  background: #111;
  color: white;
}

.rapid-btn {
  background: #f3f3f3;
  color: #111;
}

.answer-btn:active,
#start-btn:active,
.subject-btn:active,
#go-subjects-btn:active,
#back-home-btn:active,
#next-btn:active,
.mode-btn:active {
  transform: scale(0.98);
}

.answer-btn:focus,
#start-btn:focus,
.subject-btn:focus,
#go-subjects-btn:focus,
#back-home-btn:focus,
#next-btn:focus,
.mode-btn:focus {
  box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.28);
}

.answer-btn.correct {
  background: #4caf50;
  color: white;
  font-weight: bold;
}

.answer-btn.wrong {
  background: #e74c3c;
  color: white;
  font-weight: bold;
}

.answer-btn:disabled {
  opacity: 1;
}

.standard-btn:hover,
.rapid-btn:hover {
  opacity: 0.96;
}

.end-btn {
  width: 100%;
  padding: 18px 16px;
  font-size: 17px;
  font-weight: 600;
  border-radius: 14px;
  margin-top: 14px;
}

#timer-display {
  font-weight: 700;
}

.quiz-action-row {
  display: flex;
  justify-content: flex-start;
  margin-bottom: 12px;
}

.top-action-btn {
  border: none;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 600;
  background: #f3f3f3;
  color: #111;
  box-sizing: border-box;
  transition: background-color 0.2s ease, transform 0.08s ease, box-shadow 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.top-action-btn:active {
  transform: scale(0.98);
}

.top-action-btn:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.25);
}

@media (max-width: 480px) {
  body {
    padding: 12px;
  }

  .app {
    padding: 14px;
    border-radius: 14px;
  }

  .app-title {
    font-size: 28px;
  }

  .top-action-btn {
    font-size: 13px;
    padding: 9px 12px;
  }

  .answer-btn,
  #start-btn,
  .subject-btn,
  #go-subjects-btn,
  #back-home-btn,
  #next-btn,
  .mode-btn {
    font-size: 15px;
    padding: 13px 14px;
    border-radius: 10px;
  }

  .subject-card-title {
    font-size: 17px;
  }
}
