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

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

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

h1 {
  font-size: 1.6rem;
  text-align: center;
  color: #2c3e50;
  margin-bottom: 4px;
}

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

.category-filter {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}

.category-filter label {
  font-weight: bold;
  color: #555;
  white-space: nowrap;
}

#category {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 1rem;
  background: #fff;
  cursor: pointer;
  outline: none;
}

#category:focus {
  border-color: #4a90d9;
}

.topic-card {
  background: #fff;
  border-radius: 16px;
  padding: 32px 24px;
  min-height: 140px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  margin-bottom: 20px;
  text-align: center;
  transition: transform 0.1s;
}

.topic-text {
  font-size: 1.3rem;
  line-height: 1.6;
  color: #2c3e50;
  margin-bottom: 12px;
}

.topic-category {
  display: inline-block;
  background: #e8f0fe;
  color: #4a90d9;
  font-size: 0.8rem;
  padding: 3px 10px;
  border-radius: 20px;
}

.buttons {
  display: flex;
  gap: 10px;
  margin-bottom: 32px;
}

.btn-generate {
  flex: 2;
  padding: 14px;
  background: #4a90d9;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.2s;
}

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

.btn-generate:active {
  transform: scale(0.98);
}

.btn-favorite {
  flex: 1;
  padding: 14px;
  background: #fff;
  color: #f5a623;
  border: 2px solid #f5a623;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.btn-favorite:hover:not(:disabled) {
  background: #fff8eb;
}

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

.btn-favorite.added {
  background: #f5a623;
  color: #fff;
}

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

.count {
  background: #4a90d9;
  color: #fff;
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 20px;
  margin-left: 6px;
}

.favorites-list {
  list-style: none;
}

.favorites-list li {
  background: #fff;
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.fav-text {
  font-size: 0.95rem;
  color: #333;
  flex: 1;
  margin-right: 8px;
}

.fav-category {
  font-size: 0.75rem;
  color: #4a90d9;
  background: #e8f0fe;
  padding: 2px 8px;
  border-radius: 20px;
  margin-right: 8px;
  white-space: nowrap;
}

.fav-delete {
  background: none;
  border: none;
  color: #ccc;
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  transition: color 0.2s;
}

.fav-delete:hover {
  color: #e74c3c;
}

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

@media (max-width: 400px) {
  h1 {
    font-size: 1.3rem;
  }
  .topic-text {
    font-size: 1.1rem;
  }
  .buttons {
    flex-direction: column;
  }
}
