/* ---------------------------------
   Global Colors (Homeと統一)
---------------------------------- */
:root {
  --bg: #f7f9fc;
  --text-main: #1a1a1a;
  --text-sub: #666;
  --white: #fff;
  --accent: #3B82F6;
  --accent-dark: #2563EB;
  --accent-soft: #e8f0ff;
  --border: #e2e8f0;
  --shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
  --radius: 16px;
}

/* ---------------------------------
   Base
---------------------------------- */
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text-main);
  line-height: 1.7;
}

.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 32px 16px 48px;
}

/* ---------------------------------
   Titles / Text
---------------------------------- */
h1 {
  font-size: 1.7rem;
  margin-bottom: 12px;
  font-weight: 700;
}

.description {
  font-size: 0.95rem;
  color: var(--text-sub);
  line-height: 1.7;
  margin-bottom: 24px;
}

.progress {
  font-size: 0.9rem;
  margin-bottom: 14px;
  color: var(--text-sub);
}

/* ---------------------------------
   Sentence Card (ホームに寄せる)
---------------------------------- */
.sentence {
  font-size: 1.1rem;
  padding: 18px 16px;
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}

/* ---------------------------------
   Input
---------------------------------- */
.answer-area {
  margin: 20px 0 16px;
}

.answer-area label {
  display: block;
  font-size: 0.9rem;
  margin-bottom: 4px;
  color: var(--text-sub);
}

#answerInput {
  width: 100%;
  padding: 10px 12px;
  font-size: 1rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--white);
  box-sizing: border-box;
  transition: border-color 0.2s ease;
}

#answerInput:focus {
  border-color: var(--accent);
  outline: none;
}

/* ---------------------------------
   Buttons (ホームと完全統一)
---------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  margin-top: 6px;
  font-size: 0.95rem;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.2s, transform 0.1s, color 0.2s;
  border: 1px solid transparent;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn.primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.18);
}

.btn.primary:hover {
  background: var(--accent-dark);
}

.btn.secondary {
  background: var(--white);
  color: var(--accent-dark);
  border: 1px solid var(--border);
}

.btn.secondary:hover {
  background: var(--accent-soft);
}

/* disable */
.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

/* ---------------------------------
   Result
---------------------------------- */
.result {
  margin-top: 14px;
  font-size: 1rem;
  min-height: 1.3em;
}

.result.correct {
  color: #16a34a;
  font-weight: 600;
}

.result.incorrect {
  color: #dc2626;
  font-weight: 600;
}

/* ---------------------------------
   Final Result Section
---------------------------------- */
#final-area h2 {
  margin-top: 0;
  font-size: 1.4rem;
  font-weight: 700;
}

#final-area p {
  font-size: 1rem;
  margin-bottom: 12px;
}

/* ---------------------------------
   Code Highlight
---------------------------------- */
code {
  background: #edf2f7;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.85rem;
}

/* ---------------------------------
   Back Home Button
---------------------------------- */
.back-home-container {
  margin-top: 48px;
  text-align: center;
}

.back-home-btn {
  display: inline-flex;
  padding: 12px 22px;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 600;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.18);
  transition: background 0.2s ease, transform 0.1s ease;
}

.back-home-btn:hover {
  background: var(--accent-dark);
  transform: translateY(-1px);
}

/* ---------------------------------
   Explanation Section（ホーム合わせ）
---------------------------------- */
.section {
  max-width: 800px;
  margin: 36px auto 0;
  padding: 24px 20px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.section-header h2 {
  font-size: 1.3rem;
  margin: 0 0 12px;
  font-weight: 700;
  color: var(--text-main);
}

.section-body {
  font-size: 0.95rem;
}

.section-body p {
  margin: 0 0 16px;
}

.section-body ul {
  margin: 0 0 16px;
  padding-left: 1.2rem;
}

.section-body li {
  margin-bottom: 6px;
}

/* ---------------------------------
   Responsive
---------------------------------- */
@media (min-width: 768px) {
  h1 {
    font-size: 1.9rem;
  }

  .container {
    padding: 40px 20px 60px;
  }
}
