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

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

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

.logo {
  text-align: center;
  font-size: 2.5rem;
  margin-bottom: 1.5rem;
  color: #e3350d;
}

.controls {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  align-items: center;
}

.gen-buttons {
  display: flex;
  gap: 0.5rem;
}

.gen-btn {
  padding: 0.5rem 1rem;
  border: 2px solid #ddd;
  background: #fff;
  border-radius: 2rem;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.2s;
}

.gen-btn.active {
  background: #e3350d;
  color: #fff;
  border-color: #e3350d;
}

#search {
  flex: 1;
  min-width: 200px;
  padding: 0.6rem 1rem;
  border: 2px solid #ddd;
  border-radius: 2rem;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s;
}

#search:focus {
  border-color: #e3350d;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
}

.card {
  background: #fff;
  border-radius: 1rem;
  padding: 1rem;
  text-align: center;
  text-decoration: none;
  color: inherit;
  transition:
    transform 0.2s,
    box-shadow 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.card img {
  width: 120px;
  height: 120px;
  object-fit: contain;
}

.card-id {
  font-size: 0.8rem;
  color: #999;
}

.card-name {
  font-size: 1rem;
  font-weight: 600;
  text-transform: capitalize;
}

.card-types {
  display: flex;
  gap: 0.3rem;
  margin-top: 0.3rem;
}

.type-badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 1rem;
  color: #fff;
  font-size: 0.75rem;
  text-transform: capitalize;
  font-weight: 500;
}

.type-normal {
  background: #a8a878;
}
.type-fire {
  background: #f08030;
}
.type-water {
  background: #6890f0;
}
.type-electric {
  background: #f8d030;
  color: #333;
}
.type-grass {
  background: #78c850;
}
.type-ice {
  background: #98d8d8;
  color: #333;
}
.type-fighting {
  background: #c03028;
}
.type-poison {
  background: #a040a0;
}
.type-ground {
  background: #e0c068;
  color: #333;
}
.type-flying {
  background: #a890f0;
}
.type-psychic {
  background: #f85888;
}
.type-bug {
  background: #a8b820;
}
.type-rock {
  background: #b8a038;
}
.type-ghost {
  background: #705898;
}
.type-dragon {
  background: #7038f8;
}
.type-dark {
  background: #705848;
}
.type-steel {
  background: #b8b8d0;
  color: #333;
}
.type-fairy {
  background: #ee99ac;
}

.detail-page {
  max-width: 800px;
}

.back-link {
  display: inline-block;
  margin-bottom: 1.5rem;
  color: #e3350d;
  text-decoration: none;
  font-weight: 500;
}

.back-link:hover {
  text-decoration: underline;
}

.detail-header {
  display: flex;
  gap: 2rem;
  align-items: center;
  background: #fff;
  border-radius: 1rem;
  padding: 2rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.detail-image {
  width: 250px;
  height: 250px;
  object-fit: contain;
}

.detail-info {
  flex: 1;
  min-width: 200px;
}

.detail-id {
  font-size: 1.2rem;
  color: #999;
  font-weight: 600;
}

.detail-name {
  font-size: 2.5rem;
  text-transform: capitalize;
  margin: 0.3rem 0 0.8rem;
}

.detail-types {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.detail-types .type-badge {
  font-size: 0.9rem;
  padding: 0.3rem 1rem;
}

.flavor-text {
  font-style: italic;
  color: #666;
  line-height: 1.6;
}

.stats-section,
.moves-section {
  background: #fff;
  border-radius: 1rem;
  padding: 1.5rem 2rem;
  margin-bottom: 1.5rem;
}

.stats-section h2,
.moves-section h2 {
  margin-bottom: 1rem;
  font-size: 1.3rem;
}

.stat-row {
  display: grid;
  grid-template-columns: 80px 40px 1fr;
  gap: 0.8rem;
  align-items: center;
  margin-bottom: 0.6rem;
}

.stat-label {
  font-size: 0.85rem;
  color: #666;
}

.stat-value {
  font-weight: 600;
  font-size: 0.9rem;
  text-align: right;
}

.stat-bar-bg {
  background: #e8e8e8;
  border-radius: 0.5rem;
  height: 10px;
  overflow: hidden;
}

.stat-bar {
  height: 100%;
  background: #e3350d;
  border-radius: 0.5rem;
  transition: width 0.3s;
}

.moves-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.move-item {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.5rem 0.8rem;
  background: #f9f9f9;
  border-radius: 0.5rem;
}

.move-name {
  flex: 1;
  font-size: 0.9rem;
  text-transform: capitalize;
  font-weight: 500;
}

.move-pp {
  font-size: 0.85rem;
  font-weight: 600;
  color: #555;
  min-width: 45px;
  text-align: right;
}
