html,
body {
  height: 100%;
  margin: 0;
  font-family: "Courier New", Courier, monospace;
}

body {
  display: flex;
  flex-direction: column;
}

.whole-background {
  background-color: #fafad2;
  min-width: 1000px;
  width: 100%;
  overflow-x: auto;
  height: 100%;
}

.pokemon-master-title {
  font-family: "Press Start 2P", cursive;
  font-size: 40px;
  padding-top: 20px;
  padding-bottom: 20px;
  color: #000;
  text-align: center;
}

.main-container {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 40px;
  width: 70%;
  margin: auto;
}

.pokedex-link {
  margin-top: 10px;
  font-size: 12px;
  color: #444;
  font-family: "Press Start 2P", cursive;
}

.pokedex-link a {
  color: #0073e6;
  text-decoration: none;
}

.pokedex-link a:hover {
  text-decoration: underline;
}

.interaction-area {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  font-family: "Press Start 2P", cursive;
  color: #000;
  height: 50px;
  width: 100%;
  margin-bottom: 20px;
}

.interaction-area input {
  font-family: "Press Start 2P", cursive;
  display: flex;
  flex-grow: 1;
  width: max-content;
  font-size: 18px;
  padding: 5px;
  padding-left: 20px;
  border: 2px solid #000;
  border-radius: 5px;
}

.interaction-area input::placeholder {
  font-family: "Press Start 2P", cursive;
  font-size: 16px;
  color: gray;
  text-transform: uppercase;
  opacity: 1;
}

.interaction-area button {
  display: flex;
  justify-content: center;
  align-items: center;
  font-family: "Press Start 2P", cursive;
  border: 2px solid #000;
  border-radius: 5px;
  background-color: #f0f0f0;
  cursor: pointer;
  padding: 10px;
}

.interaction-area button img {
  max-width: 30px;
  height: auto;
}

.interaction-area button:hover {
  background-color: #e0e0e0;
}

.interaction-container p {
  font-size: 10px;
  animation: flash 2s infinite;
  text-align: center;
}

@keyframes shake {
  0% {
    transform: translateY(0);
  }
  25% {
    transform: translateY(-4px);
  }
  50% {
    transform: translateY(4px);
  }
  75% {
    transform: translateY(-4px);
  }
  100% {
    transform: translateY(0);
  }
}

@keyframes flash {
  0% {
    color: #000;
  }
  50% {
    color: #ff0000;
  }
  100% {
    color: #000;
  }
}

@keyframes glow {
  0% {
    box-shadow: 0 0 20px 5px #ffd700, 0 0 30px 10px #ffea00 inset;
  }
  100% {
    box-shadow: 0 0 30px 10px #ffec33, 0 0 50px 20px #fff700 inset;
  }
}

@keyframes shine {
  0% {
    background-position: top left;
  }
  50% {
    background-position: bottom right;
  }
  100% {
    background-position: top left;
  }
}

.searchPokemon-area {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background-color: #d3d3b1;
  background-image: linear-gradient(45deg, #000 1px, transparent 1px),
    linear-gradient(-45deg, #000 1px, transparent 1px);
  background-size: 20px 20px; /* 控制斜方格的大小 */
  background-position: 0 0;
  padding-bottom: 20px;
  border: 4px solid #000;
  border-radius: 10px;
}

.searchPokemon-area-shiny {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background-color: #fff152;
  background-image: linear-gradient(45deg, #000 1px, transparent 1px),
    linear-gradient(-45deg, #000 1px, transparent 1px);
  background-size: 20px 20px; /* 控制斜方格的大小 */
  background-position: 0 0;
  padding-bottom: 20px;
  border-radius: 10px;
  animation: shake 3s infinite, glow 2s infinite alternate;
}

.searchPokemon-title {
  font-family: "Press Start 2P", cursive;
  font-size: 30px;
  color: #000;
  text-align: center;
  background-color: #f0f0f0;
  box-shadow: 5px 5px 0 #000;
  padding: 20px;
  border: 4px solid #000;
  border-radius: 10px;
  width: calc(100% - 40px);
  margin: 20px;
  box-sizing: border-box;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.searchPokemon-info {
  display: flex;
  width: 100%;
  padding: 20px;
  box-sizing: border-box;
}

.searchPokemon-info img {
  width: 48%;
  height: 300px;
  object-fit: contain;
  background-color: #f0f0f0;
  border: 4px solid #000;
  border-radius: 10px;
  box-shadow: 5px 5px 0 #000;
  image-rendering: pixelated;
}

.searchPokemon-info-text {
  display: flex;
  font-family: "Press Start 2P", cursive;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  width: 50%;
  padding-left: 30px;
  box-sizing: border-box;
  gap: 15px;
  line-height: 1.6;
  font-size: 14px;
}

.searchPokemon-info-text strong {
  font-size: 20px;
  display: block;
  color: #000;
}

.searchPokemon-info-text .keywords {
  font-size: 14px;
  color: #444;
  padding-left: 10px;
}

.listPokemons-area {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  justify-content: center;
  align-items: center;
  background-color: #d3d3b1;
  background-size: 20px 20px;
  background-position: 0 0;
  padding: 20px;
  border: 4px solid #000;
  border-radius: 10px;
  overflow: hidden;
  box-sizing: border-box;
  margin-bottom: 50px;
}

.listPokemons-card,
.listPokemons-card-shiny {
  display: flex;
  flex-direction: column;
  border: 4px solid #000;
  border-radius: 10px;
  padding-top: 10px;
  padding-bottom: 10px;
  padding-left: 20px;
  padding-right: 20px;
  background-color: #f0f0f0;
  box-shadow: 5px 5px 0 #000;
  font-family: "Press Start 2P", cursive;
  position: relative;
}

.listPokemons-card-shiny {
  background-color: #fff152;
  background-image: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.6) 25%,
    rgba(255, 255, 255, 0) 25%,
    rgba(255, 255, 255, 0) 50%,
    rgba(255, 255, 255, 0.6) 50%,
    rgba(255, 255, 255, 0.6) 75%,
    rgba(255, 255, 255, 0) 75%,
    rgba(255, 255, 255, 0)
  );
  background-size: 50px 50px;
  animation: shine 10s linear infinite, shake 3s infinite;
}

.listPokemons-card:hover .listPokemons-info-text,
.listPokemons-card-shiny:hover .listPokemons-info-text {
  display: flex;
}

.listPokemons-info-text {
  display: none;
  flex-direction: column;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.8); /* Add a translucent background */
  color: #fff;
  border-radius: 5px;
  padding: 10px;
  justify-content: center;
  align-items: center;
  text-align: center;
  z-index: 1;
}

.listPokemons-card img,
.listPokemons-card-shiny img {
  display: flex;
  align-self: center;
  height: 150px;
  image-rendering: pixelated;
  object-fit: contain;
}

.listPokemons-info-text {
  font-family: "Press Start 2P", cursive;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 10px;
  line-height: 1.6;
}

.listPokemons-info-text strong {
  text-align: center;
  font-size: 10px;
  display: block;
}

.listPokemons-info-text .keywords {
  text-align: center;
  font-size: 8px;
  color: #ddd;
  padding-top: 5px;
  padding-bottom: 5px;
}

@media (max-width: 1200px) {
  .listPokemons-area {
    grid-template-columns: repeat(
      auto-fit,
      minmax(180px, 1fr)
    ); /* Slightly smaller cards */
  }
}

/* Add spinning animation for Pokéball */
@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.pokeball-icon-loading img {
  width: 50px;
  height: 50px;
  animation: spin 1s linear infinite; /* Spinning animation */
}

.loading-text {
  font-family: "Press Start 2P", cursive;
  font-size: 16px;
  color: #ff0000;
  margin-top: 10px;
}

/* Add dynamic dots animation */
@keyframes dots {
  0% {
    content: ".";
  }
  33% {
    content: "..";
  }
  66% {
    content: "...";
  }
  100% {
    content: "";
  }
}

.loading-text:after {
  content: "...";
  animation: dots 1.5s infinite;
}

.footer {
  text-align: center;
  padding: 20px;
  background-color: #333;
  color: #fff;
  position: relative;
  bottom: 0;
  width: 100%;
}

.footer a {
  text-decoration: underline;
  color: #fff;
}

.footer a:hover {
  text-decoration: underline;
}
