@import url("https://fonts.googleapis.com/css2?family=Ubuntu:ital,wght@0,300;0,400;0,500;0,700;1,300;1,400;1,500;1,700&display=swap");

:root {
  --background-color: #d6cdea;
  --text-color: white;
  --accent-color: #6ca6a6;
}

* {
  font-family: Ubuntu, sans-serif;
  transition: all 0.3s ease;
}

body {
  background-color: var(--background-color);
  color: var(--text-color);
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
}

h1#title {
  color: #3d3560;
  font-size: 2.5rem;
  margin-bottom: 0;
  margin-top: 24px;
}

p#subtitle {
  color: var(--accent-color);
  margin-top: 4px;
  font-size: 1rem;
}

#searchInput {
  padding: 17px;
  box-sizing: border-box;
  width: 100%;
  max-width: 400px;
  margin: 20px auto;
  border-radius: 10px;
  border: none;
  font-size: 24px;
  outline: none;
  text-align: center;
  transition: all 0.3s ease-in-out;
  display: block;
}

#searchInput:focus {
  border: 3px solid var(--accent-color);
}

#loadingSpinner {
  text-align: center;
  padding: 40px;
  color: #3d3560;
  font-size: 1.2rem;
}

#gamesContainer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  padding: 0 20px;
  box-sizing: border-box;
}

.game {
  position: relative;
  text-align: center;
  flex: 1 0 200px;
  max-width: 200px;
  margin: 10px;
  transition: transform 0.3s ease;
  border: 2px solid transparent;
  border-radius: 10px;
}

.game:hover {
  transform: scale(0.95);
  border: 2px solid var(--accent-color);
}

.game img {
  width: 200px;
  height: 200px;
  border-radius: 10px;
  cursor: pointer;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
  display: block;
}

.game p {
  margin-top: 5px;
  font-weight: 600;
  color: #3d3560;
}

.new-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: var(--accent-color);
  color: white;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  pointer-events: none;
}

.no-results {
  color: #3d3560;
  font-size: 1.2rem;
  margin-top: 40px;
  text-align: center;
  width: 100%;
}

.center {
  justify-content: center;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.footer {
  margin: 20px auto 10px;
  text-align: center;
}

.link {
  color: var(--accent-color);
  text-decoration: none;
}

@media only screen and (max-width: 600px) {
  .game { flex-basis: calc(50% - 20px); }
}
@media only screen and (max-width: 400px) {
  .game { flex-basis: calc(100% - 20px); }
}
@media only screen and (max-width: 450px) {
  #searchInput { width: 200px; }
}
