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

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

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

h1 {
  font-size: 1.6rem;
  color: #c0616e;
  margin-bottom: 24px;
  text-align: center;
}

h2 {
  font-size: 1rem;
  color: #888;
  margin-bottom: 12px;
  font-weight: 600;
}

/* フォームセクション */
.form-section {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.form-group {
  margin-bottom: 12px;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  color: #666;
  margin-bottom: 4px;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #e0d4cb;
  border-radius: 8px;
  font-size: 0.95rem;
  background: #fffaf7;
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: #e8a0bf;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

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

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

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

.list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.filter-group {
  font-size: 0.85rem;
  color: #666;
}

.filter-group label {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.gift-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

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

/* カード */
.gift-card {
  border: 1px solid #f0e4db;
  border-radius: 10px;
  padding: 14px;
  background: #fffaf7;
  position: relative;
}

.gift-card.returned {
  opacity: 0.5;
}

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}

.card-partner {
  font-weight: 700;
  font-size: 1rem;
  color: #c0616e;
}

.card-direction {
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 12px;
  font-weight: 600;
}

.card-direction.received {
  background: #fde8ef;
  color: #c0616e;
}

.card-direction.gave {
  background: #e8f0fd;
  color: #4a6ec0;
}

.card-content {
  font-size: 0.95rem;
  color: #555;
  margin-bottom: 6px;
}

.card-meta {
  display: flex;
  gap: 16px;
  font-size: 0.85rem;
  color: #888;
  flex-wrap: wrap;
}

.card-amount {
  font-weight: 700;
  color: #333;
}

.card-hint {
  background: #fff4e5;
  border-left: 3px solid #f5a623;
  padding: 8px 10px;
  margin-top: 10px;
  border-radius: 0 6px 6px 0;
  font-size: 0.82rem;
  color: #7a5800;
}

.card-memo {
  font-size: 0.82rem;
  color: #999;
  margin-top: 6px;
  font-style: italic;
}

.card-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.btn-return {
  padding: 6px 14px;
  background: #4caf80;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 0.82rem;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-return:hover {
  background: #3a9e6e;
}

.btn-return.undo {
  background: #aaa;
}

.btn-return.undo:hover {
  background: #888;
}

.btn-delete {
  padding: 6px 14px;
  background: transparent;
  color: #bbb;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-delete:hover {
  color: #c0616e;
  border-color: #c0616e;
}

@media (max-width: 480px) {
  h1 {
    font-size: 1.3rem;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .list-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
}
