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

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

:root {
  --background: #f0fffd;
  --foreground: #1a1a1d;
  --white: #ffffff;
}

html {
  font-size: 62.5%;
}

body {
  min-height: 100vh;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  background: var(--background);
  color: var(--foreground);
}

main {
  width: 100%;
  padding: 2rem;
}

.cards {
  max-width: 56rem;
  display: flex;
  flex-wrap: wrap;
  margin: auto;
  margin-bottom: 1rem;
}

.card {
  padding: 0.5rem;
  width: 25%;
}

.card .image {
  position: relative;
  min-height: 13rem;
  height: 100%;
  width: 100%;
  background: var(--white);
  cursor: pointer;
}

.card.show .image {
  pointer-events: none;
}

.card .image::before {
  content: "🎮";
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 100%;
  background: var(--white);
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 4rem;
  font-weight: 700;
}

.card.show .image::before {
  display: none;
}

.card .image img {
  height: 100%;
  width: 100%;
  aspect-ratio: 1/1;
  object-fit: contain;
  vertical-align: middle;
  border: 0.2rem solid transparent;
}

.game-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.game-controls button {
  background: var(--clr);
  border: 0.1rem solid var(--clr);
  color: var(--background);
  border-radius: 0.4rem;
  padding: 1rem 1.5rem;
  font-size: 1.5rem;
  font-weight: 500;
  transition: 500ms all ease;
  cursor: pointer;
}

.game-controls button:hover {
  background: transparent;
  color: var(--clr);
}

.game-controls button[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

.toast {
  position: fixed;
  top: 1rem;
  right: 1rem;
}

.toast .toaster {
  max-width: 32rem;
  width: 100%;
  font-size: 1.2rem;
  text-align: right;
  background: var(--white);
  margin-bottom: 1rem;
  padding: 0.5rem 1rem;
  border-radius: 0.4rem;
}

.toast .toaster[data-varient="success"] {
  background: #00800040;
  color: green;
}

.toast .toaster[data-varient="warning"] {
  background: #ffff0040;
  color: orange;
}

.toast .toaster[data-varient="danger"] {
  background: #ff000040;
  color: red;
}

.modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  max-width: 64rem;
  width: 90%;
  background: var(--white);
  padding: 2.5rem;
  border-radius: 0.4rem;
  z-index: 10;
  display: none;
}

.overlay {
  position: fixed;
  height: 100vh;
  width: 100%;
  top: 0;
  left: 0;
  background: #00000040;
  display: none;
}

.modal h2 {
  font-size: 2.2rem;
  text-align: center;
  margin-bottom: 1rem;
}

.game-instructions {
  max-height: 70vh;
  overflow-y: auto;
}

.game-instructions ul {
  padding-left: 0;
}

.game-instructions ul li {
  font-size: 1.4rem;
  margin-top: 1rem;
  list-style-type: none;
}

.game-instructions ul li strong {
  font-size: 1.6rem;
}

.modal .button {
  display: block;
  background: var(--foreground);
  color: var(--white);
  border: 0.2rem solid var(--foreground);
  outline: 0;
  margin: 0 auto;
  margin-top: 2rem;
  padding: 1rem 2rem;
  border-radius: 0.4rem;
  cursor: pointer;
  transition: 200ms all ease-in-out;
}

.modal .button:hover {
  background: var(--white);
  color: var(--foreground);
}

@media only screen and (max-width: 767px) {
  .card .image {
    min-height: 1rem;
  }
}

@media only screen and (max-width: 475px) {
  .card .image::before {
    font-size: 2.4rem;
  }

  .game-controls button {
    width: calc(50% - 1rem);
    font-size: 1.2rem;
    padding: 0.6rem 0;
  }
}
