@import url('https://fonts.googleapis.com/css2?family=M+PLUS+Rounded+1c:wght@400;700&display=swap');

body {
  font-family: 'M PLUS Rounded 1c', sans-serif;
  background-color: #f4fcf4;
  color: #333;
  line-height: 1.6;
  padding: 20px;
}

.app-container {
  max-width: 800px;
  margin: 0 auto;
  background: white;
  padding: 30px;
  border-radius: 15px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

h1 {
  background: #d4edda;
  padding: 10px 20px;
  border-left: 8px solid #28a745;
  border-radius: 4px;
  font-size: 1.5rem;
}

.goal {
  color: #28a745;
  font-size: 1.2rem;
  text-align: center;
  margin-top: 20px;
  padding: 10px;
  border-bottom: 2px dashed #28a745;
}

.step-card {
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 25px;
  background: #fff;
  transition: transform 0.2s;
}

.step-card:hover {
  box-shadow: 0 4px 10px rgba(0,0,0,0.03);
}

.badge {
  display: inline-block;
  background: #bbdefb;
  color: #0d47a1;
  padding: 4px 12px;
  border-radius: 20px;
  font-weight: bold;
  margin-bottom: 10px;
}

.dialogue {
  display: flex;
  align-items: center;
  margin: 15px 0;
  gap: 10px;
}

.dialogue.right {
  justify-content: flex-end;
}

.icon {
  font-size: 2rem;
}

.speech {
  background: #f1f1f1;
  padding: 10px 15px;
  border-radius: 15px;
  position: relative;
  font-weight: bold;
}

.dialogue:not(.right) .speech::before {
  content: '';
  position: absolute;
  left: -10px; top: 50%;
  transform: translateY(-50%);
  border: 10px solid transparent;
  border-right-color: #f1f1f1;
}

.dialogue.right .speech::after {
  content: '';
  position: absolute;
  right: -10px; top: 50%;
  transform: translateY(-50%);
  border: 10px solid transparent;
  border-left-color: #f1f1f1;
}

/* ビジュアル・ます */
.interactive-area {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 30px;
  margin: 20px 0;
  padding: 20px;
  background: #fafafa;
  border-radius: 10px;
}

.interactive-area.flex-row {
  flex-direction: row;
}

.cup-container {
  text-align: center;
  font-weight: bold;
}

.cup {
  width: 120px;
  height: 150px;
  border: 4px solid #424242;
  border-top: none;
  position: relative;
  background: #fff;
  margin: 0 auto 10px auto;
}

.water {
  position: absolute;
  bottom: 0;
  width: 100%;
  background: rgba(64, 196, 255, 0.6);
  transition: height 0.8s ease-in-out;
}

.grid-line {
  position: absolute;
  width: 100%;
  border-top: 1px dashed #9e9e9e;
  z-index: 2;
}

.grid-line.bold {
  border-top: 1px solid #424242;
}

/* 10等分の目盛り（JSで追加、またはクラスで一括指定） */
.with-grid .grid-line-pre {
  position: absolute;
  width: 100%;
  border-top: 1px dashed #9e9e9e;
  z-index: 2;
}

/* 入力とボタン */
.input-group {
  text-align: center;
  margin: 20px 0;
  font-size: 1.2rem;
  font-weight: bold;
}

.ans-input {
  width: 80px;
  font-size: 1.2rem;
  text-align: center;
  padding: 5px;
  border: 2px solid #ccc;
  border-radius: 5px;
  font-family: inherit;
}

.ans-input.text-ans {
  width: 120px;
}

.ans-input.correct {
  background-color: #e8f5e9;
  border-color: #4caf50;
  color: #2e7d32;
}

.ans-input.incorrect {
  background-color: #ffebee;
  border-color: #f44336;
  color: #c62828;
}

.action-btn {
  background: #2196f3;
  color: white;
  border: none;
  padding: 10px 20px;
  font-size: 1.1rem;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
  font-weight: bold;
  box-shadow: 0 4px 0 #1565c0;
  transition: all 0.1s;
}

.action-btn:active {
  transform: translateY(4px);
  box-shadow: none;
}

.hint-btn {
  background: #ffeb3b;
  border: none;
  padding: 10px 15px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: bold;
  margin-left: 10px;
}

.hint-text {
  display: none;
  background: #fff9c4;
  padding: 10px;
  border-radius: 5px;
  margin-top: 10px;
  color: #f57f17;
  font-weight: bold;
}

.important-box {
  border-left: 5px solid #ff9800;
  background: #fff3e0;
  padding: 15px;
  border-radius: 0 10px 10px 0;
  font-size: 1.1rem;
  font-weight: bold;
}

.summary-box {
  border: 3px solid #4caf50;
  background: #f1f8e9;
}

.summary-box h3 {
  background: #4caf50;
  color: white;
  display: inline-block;
  padding: 5px 15px;
  border-radius: 20px;
  margin-top: -35px;
}

.finish-area {
  text-align: center;
  margin-top: 40px;
}

.check-all-btn {
  background: #ff4081;
  box-shadow: 0 4px 0 #c51162;
  font-size: 1.3rem;
}

.final-message {
  font-size: 1.5rem;
  color: #e91e63;
  font-weight: bold;
  margin-top: 20px;
  min-height: 30px;
}