@import url("https://fonts.googleapis.com/css2?family=Open+Sans+Condensed:wght@700&family=Raleway:wght@400;500;600;700;800&display=swap");
@import url("https://fonts.googleapis.com/css2?family=Afacad+Flux:wght@100..1000&display=swap");

* {
  margin: 0;
  padding: 0;
  font-family: "Raleway", sans-serif;
  box-sizing: border-box;
}

body {
  background-color: #f2ebdd;
}

h1 {
  font-family: "Afacad Flux", serif;
  text-align: center;

  padding: 20px 0px;
  font-size: 2.9rem;
  margin: 0;
  width: 100%;
  display: block;
}

h2 {
  font-family: "Open Sans Condensed", sans-serif;
  font-size: 1.8rem;
  text-align: center;
  -webkit-text-stroke: 0.4px #ddd;
}

#container {
  min-height: 100vh;
  width: 100vw;
  background-color: #f2ebdd;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

#cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  /* 4 cards per row */
  gap: 20px;
  /* Space between cards */
  max-width: 900px;
  /* Ensures a reasonable width */
  justify-content: center;
}

.card {
  height: 500px;
  width: 220px;
  background-color: #fff;
  border: 4px solid black;
  box-shadow: 0 0 0 5px #fff, 0 0 6px 3px #000;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
}

.card-image {
  width: 100%;
  height: 65%;
  background-color: #ffdd33;
  position: relative;
  border-bottom: 4px solid #000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.card-image img {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
}

.card-text {
  height: 45%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 10px;
  text-align: center;
  color: #fff;
}

.card-text p {
  font-size: 1.1rem;
  font-weight: 600;
  text-transform: capitalize;
}

.stats-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 10px 0px;
  color: #fff;
}

.stats-container div {
  font-size: 0.9rem;
  font-weight: 600;
}

.abilities-container {
  margin-top: 5px;
}

.card__ability {
  font-size: 0.9rem;
  font-weight: 600;
}

.card__type {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background-color: #333;
  color: white;
  font-size: 0.85rem;
  font-weight: bold;
  text-transform: uppercase;
  padding: 5px 10px;
  border-radius: 15px;
  box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.3);
  border: 2px solid white;
}

/* Adjusting different Pokémon type colors */
.card--fire .card-image {
  background-color: #ff5733;
}

.card--water .card-image {
  background-color: #3498db;
}

.card--electric .card-image {
  background-color: #f4d03f;
}

.card--grass .card-image {
  background-color: #58d68d;
}

.card--psychic .card-image {
  background-color: #af7ac5;
}

.card--ice .card-image {
  background-color: #a9cce3;
}

.card--fairy .card-image {
  background-color: #f1948a;
}

.card--dark .card-image {
  background-color: #5d6d7e;
}

.card--normal .card-image {
  background-color: #bdc3c7;
}

.card--fire h2 {
  color: #e74c3c;
  /* Red */
}

.card--water h2 {
  color: #3498db;
  /* Blue */
}

.card--electric h2 {
  color: #f1c40f;
  /* Yellow */
}

.card--grass h2 {
  color: #2ecc71;
  /* Green */
}

.card--psychic h2 {
  color: #9b59b6;
  /* Purple */
}

.card--ice h2 {
  color: #5dade2;
  /* Light Blue */
}

.card--fairy h2 {
  color: #ff85a2;
  /* Pink */
}

.card--dark h2 {
  color: #34495e;
  /* Dark Gray */
}

.card--normal h2 {
  color: #95a5a6;
  /* Light Gray */
}

.card--normal {
  background: linear-gradient(110deg, rgba(253, 187, 45, 1) 0%, #3a1c71 100%);
  box-shadow: 0px 5px 20px -10px #3a1c71;
}

.card--normal .card__type {
  background-color: #c08a53;
}

.card--water {
  background: linear-gradient(120deg, #1cb5e0 0%, #000851 100%);
  box-shadow: 0px 5px 20px -10px #000851;
}

.card--water .card__type {
  background-color: #1cb5e0;
}

.card--electric {
  background: linear-gradient(90deg, #ffde00 34%, #e8ff99 83%);
}

.card--electric .card__type {
  background-color: #000;
}

.card--fire {
  background: linear-gradient(0deg, #c71800 10%, #fcc245 100%);
}

.card--fire .card__type {
  background-color: #c71800;
}

.card--psychic {
  background: linear-gradient(140deg, #ffa7f9 0%, #ff2cc3 39%, #ffe3a7 100%);
}

.card--psychic .card__type {
  background: #ff2cc3;
}

.card--dark {
  background: linear-gradient(20deg, #191919 0%, #100b32 33%, #5c0249 100%);
}

.card--dark .card__type {
  background: #5c0249;
}

.card--grass {
  background: linear-gradient(140deg, #c4da3d 0%, #6e7f0e 69%, #275009 100%);
}

.card--grass .card__type {
  background: #6e7f0e;
}

.card--ice {
  background: linear-gradient(230deg, #caeaf6 0%, #a0eaf1 46%, #6fb8eb 100%);
}

.card--ice .card__type {
  background: #6fb8eb;
}

.card--fairy {
  background: linear-gradient(45deg,
      #ffe6f0 0%,
      #ffc5e0 34%,
      #ffa6b9 71%,
      #ff8a95 100%);
}

.card--fairy .card__type {
  background: #ff8a95;
}

/* Responsive Adjustments */
@media screen and (max-width: 900px) {
  #cards {
    grid-template-columns: repeat(2,
        1fr);
    /* 2 cards per row on smaller screens */
  }
}

@media screen and (max-width: 500px) {
  #cards {
    grid-template-columns: repeat(1, 1fr);
    /* 1 card per row on mobile */
  }
}