@font-face {
  font-family: Fredoka;
  src: url(./FredokaOne-Regular.ttf);
}

html {
  width: 100%;
  height: 100%;
  background-image: url("./background.webp");
  background-position: center center;
  font-family: Fredoka;
}

body {
  touch-action: manipulation;
}

.game {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.controls {
  display: flex;
  width: 100%;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 20px;
}

button {
  background-color: #3a519f;
  color: #fff;
  border-radius: 5px;
  padding: 12px 20px;
  border: 0;
  cursor: pointer;
  font-family: Fredoka;
  font-size: 18pt;
}

button:hover {
  background-color: #b0cb1f;
  color: #1b1c1e;
}

.stats {
  background-color: #990000;
  color: #fff;
  font-size: 14pt;
  padding: 16px;
  border-radius: 4px;
  width: 124px;
}
.board-container {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

.board,
.win {
  border-radius: 5px;
  box-shadow: 0 25px 50px rgb(33 33 33 / 25%);
  /* background: linear-gradient(135deg, #6f00fc 0%, #fc7900 50%, #fcc700 100%); */
  background: #ffffff;
  border: 1px solid #990000;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  backface-visibility: hidden;
}

.board {
  display: grid;
  grid-template-columns: repeat(4, auto);
  grid-gap: 24px;
  padding: 24px;
}

.board-container.flipped .board {
  transform: rotateY(180deg) rotateZ(50deg);
}

.board-container.flipped .win {
  transform: rotateY(0) rotateZ(0);
}

.card {
  position: relative;
  width: 100px;
  height: 100px;
  cursor: pointer;
}

.card-front,
.card-back {
  position: absolute;
  border-radius: 5px;
  width: 100%;
  height: 100%;
  background: #3a519f;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  backface-visibility: hidden;
}

.card-front {
  background-image: url("./Default\ Logo.png");
  background-position: center;
  background-size: 80%;
  background-repeat: no-repeat;
}

.card-back {
  transform: rotateY(180deg) rotateZ(50deg);
  font-size: 28pt;
  display: flex;
  justify-content: center;
  align-items: center;
  user-select: none;
  text-align: center;
  line-height: 100px;
  background: #fdf8e6;
}

.card-back img {
  width: 80%;
  height: auto;
}

.card.flipped .card-front {
  transform: rotateY(180deg) rotateZ(50deg);
}

.card.flipped .card-back {
  transform: rotateY(0) rotateZ(0);
}

.win {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  text-align: center;
  background: #fff;
  transform: rotateY(180deg) rotateZ(50deg);
}

.win-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 21pt;
  color: #3a519f;
}

.highlight {
  color: #990000;
}

#theme-selector {
  padding: 10px;
  font-size: 16pt;
  border-radius: 5px;
  border: 1px solid #990000;
  background-color: #3a519f;
  color: white;
  font-family: Fredoka;
}

.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  display: none; /* Hide it by default */
}

footer {
  display: flex;
  position: absolute;
  bottom: 0;
  left: 0;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.5rem;
  background-color: var(--light);
  text-align: center;
  font-size: 0.8rem;
  margin-top: 80px;
}

footer a {
  color: var(--primary);
}

footer a:hover {
  color: var(--accent);
}
