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

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

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

h1 {
  text-align: center;
  font-size: 1.5rem;
  margin-bottom: 20px;
  color: #444;
}

/* 入力セクション */
.mood-input {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  margin-bottom: 24px;
}

.date-label {
  text-align: center;
  font-size: 0.85rem;
  color: #888;
  margin-bottom: 8px;
}

.prompt {
  text-align: center;
  font-size: 1.1rem;
  font-weight: bold;
  margin-bottom: 14px;
  color: #555;
}

.mood-buttons {
  display: flex;
  justify-content: space-around;
  gap: 8px;
  margin-bottom: 14px;
}

.mood-btn {
  font-size: 2.2rem;
  background: none;
  border: 2px solid transparent;
  border-radius: 50%;
  width: 56px;
  height: 56px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.1s, border-color 0.1s;
}

.mood-btn:hover {
  transform: scale(1.15);
}

.mood-btn.active {
  border-color: #4a90d9;
  background: #e8f0fb;
  transform: scale(1.15);
}

.selected-mood {
  text-align: center;
  font-size: 1rem;
  color: #4a90d9;
  min-height: 24px;
  margin-bottom: 10px;
  font-weight: bold;
}

textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 0.95rem;
  resize: none;
  font-family: inherit;
  color: #333;
  background: #fafafa;
}

textarea:focus {
  outline: none;
  border-color: #4a90d9;
  background: #fff;
}

.save-btn {
  display: block;
  width: 100%;
  margin-top: 12px;
  padding: 12px;
  background: #4a90d9;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.2s;
}

.save-btn:hover {
  background: #357abd;
}

.save-btn:disabled {
  background: #aaa;
  cursor: not-allowed;
}

.save-msg {
  text-align: center;
  font-size: 0.85rem;
  color: #5a9a5a;
  min-height: 20px;
  margin-top: 8px;
}

/* 一覧セクション */
.history {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.history h2 {
  font-size: 1.1rem;
  margin-bottom: 12px;
  color: #555;
}

.filter-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.filter-row label {
  font-size: 0.85rem;
  color: #777;
}

#filterMonth {
  padding: 4px 8px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 0.9rem;
  color: #333;
}

#clearFilter {
  padding: 4px 10px;
  background: #eee;
  border: none;
  border-radius: 6px;
  font-size: 0.85rem;
  cursor: pointer;
  color: #555;
}

#clearFilter:hover {
  background: #ddd;
}

#recordList {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.record-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  border-left: 4px solid;
}

.record-item[data-mood="1"] { background: #fde8e8; border-color: #e57373; }
.record-item[data-mood="2"] { background: #fde8d8; border-color: #f39260; }
.record-item[data-mood="3"] { background: #f5f5e8; border-color: #c8c87a; }
.record-item[data-mood="4"] { background: #e8f5e9; border-color: #81c784; }
.record-item[data-mood="5"] { background: #e8f0fb; border-color: #64b5f6; }

.record-emoji {
  font-size: 1.6rem;
  line-height: 1;
  flex-shrink: 0;
}

.record-content {
  flex: 1;
  min-width: 0;
}

.record-date {
  font-size: 0.8rem;
  color: #888;
  margin-bottom: 2px;
}

.record-label {
  font-weight: bold;
  font-size: 0.95rem;
  color: #444;
}

.record-note {
  font-size: 0.85rem;
  color: #666;
  margin-top: 4px;
  word-break: break-word;
}

.record-delete {
  background: none;
  border: none;
  cursor: pointer;
  color: #bbb;
  font-size: 1rem;
  padding: 0 2px;
  flex-shrink: 0;
  align-self: center;
}

.record-delete:hover {
  color: #e57373;
}

.empty-msg {
  text-align: center;
  color: #aaa;
  font-size: 0.9rem;
  padding: 16px 0;
  display: none;
}

@media (max-width: 375px) {
  .mood-btn {
    font-size: 1.8rem;
    width: 46px;
    height: 46px;
  }
}
