@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: #f5f8e9;
  color: #333;
  margin: 0;
  padding: 20px;
}

.app-container {
  max-width: 800px;
  margin: 0 auto;
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  overflow: hidden;
}

header {
  background-color: #e0f2f1;
  padding: 20px;
  border-bottom: 4px solid #b2dfdb;
}

.lesson-header {
  background: #37474f;
  color: white;
  display: inline-block;
  padding: 4px 12px;
  border-radius: 4px;
  font-weight: bold;
  font-size: 0.9em;
  margin-bottom: 10px;
}

h1 {
  font-size: 1.2em;
  color: #555;
  margin: 0 0 5px 0;
}

h2 {
  color: #2e7d32;
  font-size: 1.6em;
  margin: 0;
}

.problem-section, .practice-section {
  padding: 20px;
  border-bottom: 2px dashed #eee;
}

.problem-text {
  border-left: 5px solid #ff9800;
  padding-left: 15px;
  font-size: 1.2em;
  font-weight: bold;
  background: #fff8e1;
  padding: 15px;
  border-radius: 0 8px 8px 0;
}

/* Number Line */
.number-line-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 20px 0;
  padding: 15px;
  background: #fafafa;
  border-radius: 8px;
}

.number-line-box {
  width: 60%;
}

.paper-bar {
  display: flex;
  height: 25px;
  border: 1px solid #333;
  margin-bottom: 5px;
}

.bar-segment {
  flex: 1;
  border-right: 1px dashed #999;
  background-color: #ffcdd2;
  transition: background-color 0.3s;
}
.bar-segment:last-child { border-right: none; }

.line-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.9em;
}

.equation-box {
  font-size: 1.2em;
  color: #d32f2f;
  font-weight: bold;
}
.equation-box input {
  width: 100px;
  font-size: 1em;
  padding: 5px;
  color: #d32f2f;
  border: 2px solid #ffcdd2;
  border-radius: 4px;
}

/* Interactive Area */
.interactive-area {
  background: #e3f2fd;
  padding: 20px;
  border-radius: 8px;
  text-align: center;
  margin-bottom: 20px;
}

.source-area {
  display: flex;
  justify-content: center;
  gap: 10px;
  min-height: 50px;
  margin-bottom: 20px;
  padding: 10px;
  background: rgba(255,255,255,0.5);
  border-radius: 8px;
}

.bundle {
  width: 40px;
  height: 30px;
  background: #f48fb1;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  border-radius: 4px;
  cursor: grab;
  box-shadow: 2px 2px 0 #c2185b;
}
.bundle:active { cursor: grabbing; }

.people-area {
  display: flex;
  justify-content: space-around;
}

.person-box {
  width: 30%;
  background: white;
  border: 2px solid #bbdefb;
  border-radius: 8px;
  padding: 10px;
}

.person-icon {
  font-size: 2em;
}

.drop-zone {
  min-height: 60px;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  justify-content: center;
  align-items: center;
  border: 2px dashed #e0e0e0;
  border-radius: 4px;
  margin-top: 10px;
  padding: 5px;
}
.drop-zone.hover { background: #f0f8ff; }

/* Thinking Area */
.thinking-area {
  margin-top: 20px;
}

.highlight {
  border-bottom: 2px solid #4caf50;
  font-weight: bold;
}

button {
  background: #4caf50;
  color: white;
  border: none;
  padding: 10px 20px;
  font-size: 1.1em;
  border-radius: 20px;
  cursor: pointer;
  box-shadow: 0 3px 0 #388e3c;
  font-family: inherit;
  margin: 10px 0;
}
button:hover { background: #43a047; }
button:active { transform: translateY(3px); box-shadow: none; }

#hint-btn {
  background: #ffb300;
  box-shadow: 0 3px 0 #ff8f00;
}

.hint-box {
  background: #fff3e0;
  border: 2px solid #ffcc80;
  padding: 15px;
  border-radius: 8px;
  margin-bottom: 15px;
}
.hidden { display: none; }

.short-input {
  width: 50px;
  font-size: 1em;
  text-align: center;
  padding: 5px;
  border: 2px solid #ccc;
  border-radius: 4px;
}

.result-text {
  font-weight: bold;
  font-size: 1.2em;
  margin-top: 10px;
  min-height: 24px;
}
.correct { color: #d32f2f; }
.incorrect { color: #1976d2; }

/* Practice Section */
.practice-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

.practice-item {
  width: 45%;
  font-size: 1.3em;
  display: flex;
  align-items: center;
}
.practice-item input {
  width: 60px;
  font-size: 1em;
  margin-left: 10px;
  text-align: center;
  border: 2px solid #bcaaa4;
  border-radius: 4px;
}
.p-result { margin-left: 10px; font-weight: bold; }