.equation {
  padding: 24px 16px;
  background-color: #dfffff;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  /* スマホで折り返す */
  gap: 10px;
  /* 要素間の隙間 */
  justify-content: center;
  /* 中央寄せ */
}

.fraction {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 150px;
}

.line {
  width: 100%;
  height: 1px;
  background-color: black;
  margin: 0.25em 0;
}

.equal {
  font-size: 1.5em;
  margin: 0 1em;
}

.fraction input {
  width: 100%;
  height: 32px;
  text-align: center;
}

.fraction .right {
  color: red;
  font-weight: 600;
}

.fraction.result {
  font-weight: 600;
}

.cred {
  color: red;
}

@media(max-width: 768px) {
  .fraction {
    width: 100px;
  }

  .equal {
    font-size: 1em;
    margin: 0 0.5em;
  }

}

#count-display.loading::after {
  content: "";
  display: inline-block;
  width: 1em;
  text-align: left;
  animation: dots 1.2s steps(3, end) infinite;
}

@keyframes dots {
  0% {
    content: "";
  }

  33% {
    content: ".";
  }

  66% {
    content: "..";
  }

  100% {
    content: "...";
  }
}

p.sticky-note {
  margin-bottom: 8px;
  color: #aaaaaa;
  font-size: 0.8rem;
}

/* --- New Features Styles --- */

.hidden {
  display: none !important;
}

/* Explanation */
.explanation-area {
  margin-top: 16px;
  padding: 16px;
  background: #fff8e1;
  border: 1px solid #ffe082;
  border-radius: 8px;
  font-size: 0.9rem;
}

.exp-title {
  font-weight: bold;
  margin-bottom: 8px;
  color: #f57f17;
}

.exp-box p {
  margin: 4px 0;
}

.exp-box strong {
  color: #d32f2f;
  background: #ffcdd2;
  padding: 0 4px;
  border-radius: 2px;
}

/* Quiz Controls */
.controls {
  text-align: center;
  margin: 10px 0;
}

.btn-quiz,
.btn-check,
.btn-quit {
  background: #2196f3;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9rem;
}

.btn-check {
  background: #4caf50;
  margin-left: 10px;
}

.btn-quit {
  background: #f44336;
  margin-left: 10px;
}

.btn-quit:hover {
  background: #d32f2f;
}

.btn-quiz:hover {
  background: #1976d2;
}

.btn-check:hover {
  background: #388e3c;
}

.quiz-area {
  border: 2px dashed #2196f3;
  padding: 16px;
  border-radius: 8px;
  text-align: center;
  margin: 10px 0;
  background: #e3f2fd;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* .quiz-question-container removed */

.quiz-container-row {
  margin-bottom: 20px;
}

.quiz-area .equation {
  background-color: transparent;
  /* input周りの背景も透明に */
  padding: 0;
}

.quiz-area .instruction {
  margin-bottom: 10px;
  color: #0d47a1;
  font-weight: bold;
}

#quiz-message {
  margin-top: 10px;
  font-weight: bold;
}

#quiz-message.success {
  color: #2e7d32;
}

#quiz-message.error {
  color: #c62828;
}

.quiz-difficulty {
  padding: 8px 12px;
  border: 2px solid #2196f3;
  border-radius: 4px;
  background-color: white;
  color: #0d47a1;
  font-weight: bold;
  cursor: pointer;
  outline: none;
  transition: all 0.3s ease;
}

.quiz-difficulty:hover {
  background-color: #e3f2fd;
}

/* Responsive adjustments */
@media(max-width: 768px) {}