body,
html {
  height: 100%;
  margin: 0;
  padding: 0;
  font-family: "Arial", sans-serif;
  background-color: #f4f4f4;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  overflow-y: scroll;
}

.container {
  width: 90%;
  max-width: 960px;
}

.search-box {
  margin-bottom: 20px;
}

.search-box input {
  width: 70%;
  padding: 10px;
  margin-right: 10px;
  border: 1px solid #ccc;
  border-radius: 5px;
}

.search-box button {
  padding: 10px 20px;
  border: none;
  border-radius: 5px;
  background-color: #007bff;
  color: white;
  cursor: pointer;
}

.grid-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 20px;
}

.dictionary-button {
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 5px;
  background-color: #f8f8f8;
  cursor: pointer;
  transition: background-color 0.3s, color 0.3s;
}

.dictionary-button.selected {
  background-color: #007bff;
  color: white;
}

.dictionary-button:hover {
  background-color: #0056b3;
  color: white;
}

.dictionary-button:hover::after {
  content: attr(data-summary);
  position: absolute;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 5px;
  border-radius: 5px;
  bottom: -35px;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  font-size: 12px;
  z-index: 1000;
  visibility: hidden;
  opacity: 0;
  transition: visibility 0s, opacity 0.5s ease, bottom 0.5s ease;
}

.dictionary-button:hover::after {
  visibility: visible;
  opacity: 1;
  bottom: -45px;
}

.control-buttons {
  margin-top: 20px;
}

.control-buttons button {
  padding: 10px 20px;
  border: none;
  border-radius: 5px;
  background-color: #007bff;
  color: white;
  cursor: pointer;
  margin: 0 5px;
}

@media (max-width: 768px) {
  .grid-container {
    grid-template-columns: repeat(2, 1fr);
  }

  .search-box input,
  .search-box button {
    width: 100%;
    margin-right: 0;
  }
}

@media (max-width: 480px) {
  .grid-container {
    grid-template-columns: 1fr;
  }
}
