:root {
  --main-green: #2ecc71;
  --dark-green: #27ae60;
  --light-green: #eafaf1;
  --wood-color: #d4a373;
  --text-dark: #333;
}

body {
  font-family: "Hiragino Maru Gothic ProN", "Meiryo", sans-serif;
  background-color: #f4f7f6;
  color: var(--text-dark);
  margin: 0;
  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.1);
}

header {
  border-bottom: 4px solid var(--main-green);
  padding-bottom: 10px;
  margin-bottom: 25px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
}

.page-num {
  background: var(--main-green);
  color: white;
  font-size: 28px;
  font-weight: bold;
  padding: 5px 15px;
  border-radius: 8px;
  margin-right: 15px;
}

h1 { margin: 0; font-size: 22px; color: var(--dark-green); flex: 1; }
.subtitle { width: 100%; margin: 10px 0 0 0; font-size: 16px; padding-left: 60px; }

.mission-card {
  background: white;
  border: 3px dashed var(--main-green);
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 25px;
}

h2 {
  color: var(--dark-green);
  font-size: 18px;
  background: var(--light-green);
  padding: 8px 15px;
  border-radius: 5px;
  margin-top: 0;
}

/* 操作パネル */
.control-panel {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 20px;
  background: #f8f9fa;
  padding: 15px;
  border-radius: 8px;
}

select {
  font-size: 16px;
  padding: 5px 10px;
  border: 2px solid var(--main-green);
  border-radius: 5px;
  font-family: inherit;
}

/* てんびんUI */
.scale-area {
  margin: 30px auto;
  width: 300px;
  position: relative;
  height: 220px;
}

.scale-beam-container {
  position: absolute;
  top: 50px;
  left: 0;
  width: 100%;
  height: 20px;
  display: flex;
  justify-content: center;
}

.scale-beam {
  width: 260px;
  height: 12px;
  background: var(--wood-color);
  position: relative;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  transform-origin: center center;
  border-radius: 6px;
  z-index: 2;
  box-shadow: 0 3px 5px rgba(0,0,0,0.2);
}

.scale-string {
  position: absolute;
  width: 2px;
  height: 80px;
  background: #e74c3c; /* 赤い糸 */
  top: 12px;
}
.scale-string::before, .scale-string::after {
  content: ''; position: absolute; width: 2px; height: 80px; background: #e74c3c; top: 0;
}
.scale-string::before { transform: rotate(15deg); transform-origin: top; }
.scale-string::after { transform: rotate(-15deg); transform-origin: top; }

.scale-string.left { left: 15px; }
.scale-string.right { right: 15px; }

.cup {
  position: absolute;
  bottom: -45px;
  left: -24px;
  width: 50px;
  height: 45px;
  border: 2px solid rgba(255,255,255,0.7);
  background: rgba(173, 216, 230, 0.5); /* 半透明のプラカップ */
  border-radius: 5px 5px 15px 15px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.item-icon { font-size: 28px; }
.count-display {
  font-size: 12px;
  font-weight: bold;
  background: white;
  padding: 2px 5px;
  border-radius: 10px;
  position: absolute;
  bottom: -20px;
  white-space: nowrap;
}

.scale-pivot {
  position: absolute;
  top: 60px;
  left: 140px;
  width: 0;
  height: 0;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-bottom: 100px solid #34495e;
  z-index: 1;
}

.scale-base {
  position: absolute;
  top: 160px;
  left: 100px;
  width: 100px;
  height: 15px;
  background: #34495e;
  border-radius: 5px;
}

/* ボタン類 */
.action-buttons {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-top: 20px;
}

.add-btn {
  border: none;
  padding: 10px 20px;
  border-radius: 20px;
  font-weight: bold;
  font-size: 16px;
  cursor: pointer;
  color: white;
  box-shadow: 0 4px #ccc;
  transition: transform 0.1s, box-shadow 0.1s;
}
.add-btn:active { transform: translateY(4px); box-shadow: 0 0 #ccc; }
.add-btn.ten { background: #e67e22; box-shadow: 0 4px #d35400; }
.add-btn.one { background: #f1c40f; color: #333; box-shadow: 0 4px #f39c12; }
.reset-btn { background: #95a5a6; color: white; border: none; border-radius: 20px; padding: 10px 15px; cursor: pointer;}

.feedback-message {
  text-align: center;
  font-weight: bold;
  font-size: 18px;
  margin-top: 20px;
  height: 24px;
}

/* きれいな表のスタイル */
.data-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 15px;
  background: white;
}
.data-table th, .data-table td {
  border: 2px solid #bdc3c7;
  padding: 12px;
  text-align: center;
  font-size: 16px;
}
.data-table th { background-color: #ebedef; }
.table-input {
  width: 50px;
  font-size: 16px;
  text-align: center;
  padding: 5px;
  border: 2px solid var(--main-green);
  border-radius: 4px;
  font-family: inherit;
}

/* ヒント・考察エリア */
.hint-section { text-align: center; margin-bottom: 20px; }
.hint-btn {
  background: #fff; border: 2px solid #f1c40f; padding: 10px 20px; border-radius: 20px;
  font-weight: bold; cursor: pointer; color: #d35400;
}
.hint-box {
  display: none; background: #fff3cd; border-radius: 10px; padding: 15px;
  margin-top: 10px; text-align: left; line-height: 1.6;
}
.hint-box p { margin: 5px 0; border-bottom: 1px dashed #ccc; padding-bottom: 5px;}

.reflection-area h3 { font-size: 16px; color: var(--dark-green); margin-top: 20px; }
textarea {
  width: 100%; box-sizing: border-box; border: 2px solid #bdc3c7; border-radius: 5px;
  padding: 10px; font-size: 16px; font-family: inherit; resize: vertical;
}

.summary-box {
  background: white; padding: 15px; border-radius: 5px;
  border-left: 5px solid var(--main-green); font-size: 18px; font-weight: bold;
}
.fill-in-blank {
  width: 120px; font-size: 18px; border: none; border-bottom: 2px solid #333;
  text-align: center; outline: none; font-family: inherit; background: #fafafa;
}