* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #fff8f0;
  color: #333;
  min-height: 100vh;
}

.container {
  max-width: 600px;
  margin: 0 auto;
  padding: 16px;
}

header {
  text-align: center;
  padding: 20px 0 12px;
}

header h1 {
  font-size: 1.6rem;
  color: #ff9f43;
}

/* セクション共通 */
section {
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.07);
}

section h2 {
  font-size: 1rem;
  margin-bottom: 12px;
  color: #555;
}

/* ご褒美セクション */
.reward-header,
.history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.reward-header h2,
.history-header h2 {
  margin-bottom: 0;
}

.reward-display {
  text-align: center;
}

.reward-name {
  font-size: 1.1rem;
  font-weight: bold;
  color: #ff9f43;
  margin-bottom: 8px;
  min-height: 1.5rem;
}

.point-summary {
  font-size: 1.4rem;
  font-weight: bold;
  margin-bottom: 10px;
  color: #333;
}

.current-points {
  color: #ff9f43;
  font-size: 1.8rem;
}

.unit {
  font-size: 1rem;
  color: #888;
}

.progress-bar-wrap {
  background: #ffe0c0;
  border-radius: 99px;
  height: 20px;
  overflow: hidden;
  margin-bottom: 6px;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #ff9f43, #ff6b6b);
  border-radius: 99px;
  width: 0%;
  transition: width 0.4s ease;
}

.progress-label {
  font-size: 0.85rem;
  color: #888;
  margin-bottom: 4px;
}

.achieved-banner {
  background: #fff3cd;
  color: #856404;
  border: 1px solid #ffc107;
  border-radius: 8px;
  padding: 10px;
  font-size: 1.1rem;
  font-weight: bold;
  margin-top: 10px;
}

.hidden {
  display: none;
}

/* ご褒美フォーム */
.reward-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.reward-form input {
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 0.95rem;
  width: 100%;
}

/* 入力セクション */
.input-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.input-row input[type="text"] {
  flex: 1;
  min-width: 140px;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 0.95rem;
}

.input-row input[type="number"] {
  width: 70px;
  padding: 10px 8px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 0.95rem;
  text-align: center;
}

/* ボタン */
.btn-primary {
  background: #ff9f43;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 0.95rem;
  cursor: pointer;
  font-weight: bold;
  white-space: nowrap;
  transition: background 0.2s;
}

.btn-primary:hover {
  background: #e8882e;
}

.btn-edit {
  background: #f0f0f0;
  color: #555;
  border: none;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 0.85rem;
  cursor: pointer;
}

.btn-edit:hover {
  background: #e0e0e0;
}

.btn-danger {
  background: transparent;
  color: #e74c3c;
  border: 1px solid #e74c3c;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 0.85rem;
  cursor: pointer;
}

.btn-danger:hover {
  background: #fdecea;
}

/* 履歴リスト */
.task-list {
  list-style: none;
}

.empty-msg {
  text-align: center;
  color: #bbb;
  padding: 20px 0;
  font-size: 0.9rem;
}

.task-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 4px;
  border-bottom: 1px solid #f0f0f0;
}

.task-item:last-child {
  border-bottom: none;
}

.task-info {
  flex: 1;
}

.task-name {
  font-size: 0.95rem;
  font-weight: bold;
}

.task-date {
  font-size: 0.78rem;
  color: #bbb;
  margin-top: 2px;
}

.task-point {
  font-size: 1.1rem;
  font-weight: bold;
  color: #ff9f43;
  margin: 0 12px;
}

.btn-delete {
  background: none;
  border: none;
  color: #ccc;
  font-size: 1.1rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
}

.btn-delete:hover {
  color: #e74c3c;
  background: #fdecea;
}

@media (max-width: 400px) {
  header h1 {
    font-size: 1.3rem;
  }
  .input-row input[type="number"] {
    width: 60px;
  }
}
