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

body {
  font-family: 'Hiragino Sans', 'Meiryo', sans-serif;
  background: #fff5f8;
  color: #333;
  min-height: 100vh;
  padding: 16px;
}

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

h1 {
  font-size: 1.5rem;
  text-align: center;
  margin-top: 16px;
  color: #d94f7a;
}

.subtitle {
  text-align: center;
  color: #888;
  font-size: 0.85rem;
  margin-top: 4px;
  margin-bottom: 24px;
}

/* カテゴリ */
.category-section {
  margin-bottom: 20px;
}

.category-section label {
  display: block;
  font-size: 0.9rem;
  font-weight: bold;
  margin-bottom: 6px;
  color: #555;
}

#category {
  width: 100%;
  padding: 10px 12px;
  border: 2px solid #f0b8cc;
  border-radius: 10px;
  font-size: 1rem;
  background: #fff;
  color: #333;
  cursor: pointer;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
}

#category:focus {
  border-color: #d94f7a;
}

/* お題表示 */
.result-section {
  background: #fff;
  border-radius: 16px;
  padding: 24px 20px;
  box-shadow: 0 2px 12px rgba(217, 79, 122, 0.1);
  margin-bottom: 24px;
}

.topic-display {
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 1.4rem;
  font-weight: bold;
  color: #d94f7a;
  background: #fff5f8;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
  border: 2px dashed #f0b8cc;
  word-break: break-all;
}

.buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn-primary {
  flex: 1;
  padding: 12px;
  background: #d94f7a;
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.2s;
}

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

.btn-secondary {
  flex: 1;
  padding: 12px;
  background: #fff;
  color: #d94f7a;
  border: 2px solid #d94f7a;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-secondary:hover:not(:disabled) {
  background: #fff5f8;
}

.btn-secondary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* お気に入り */
.favorites-section h2 {
  font-size: 1rem;
  color: #555;
  margin-bottom: 12px;
}

#fav-count {
  color: #d94f7a;
}

.favorites-list {
  background: #fff;
  border-radius: 12px;
  padding: 12px;
  box-shadow: 0 1px 6px rgba(0,0,0,0.06);
  margin-bottom: 12px;
  min-height: 60px;
}

.empty-msg {
  text-align: center;
  color: #aaa;
  font-size: 0.85rem;
  padding: 12px 0;
}

.fav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 8px;
  border-bottom: 1px solid #f5e0e8;
  font-size: 0.95rem;
  gap: 8px;
}

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

.fav-item .fav-label {
  flex: 1;
}

.fav-category {
  font-size: 0.75rem;
  color: #aaa;
  margin-left: 6px;
}

.fav-delete-btn {
  background: none;
  border: none;
  color: #ccc;
  font-size: 1.1rem;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 6px;
  transition: color 0.2s;
}

.fav-delete-btn:hover {
  color: #d94f7a;
}

.btn-danger {
  width: 100%;
  padding: 10px;
  background: none;
  color: #aaa;
  border: 1px solid #ddd;
  border-radius: 10px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-danger:hover {
  border-color: #d94f7a;
  color: #d94f7a;
}

/* アニメーション */
@keyframes pop {
  0% { transform: scale(0.9); opacity: 0.5; }
  100% { transform: scale(1); opacity: 1; }
}

.topic-display.animate {
  animation: pop 0.25s ease-out;
}

@media (max-width: 375px) {
  h1 { font-size: 1.3rem; }
  .topic-display { font-size: 1.2rem; }
}
