@font-face {
  font-family: Bakudai-Regular;
  src: url("./assets/Bakudai-Regular.ttf");
}
:root {
  --brand-color: #e4c494;
  --border-color: #cca873;
}

body {
  background-color: #f2f2f2;
  font-family: "Bakudai-Regular";
  margin: 0px;
}

h1 {
  font-size: 7vw;
  text-shadow:
    #fff 0 0 0.24rem,
    #fff 0 0 0.24rem,
    #fff 0 0 0.24rem,
    #fff 0 0 0.24rem,
    #fff 0 0 0.24rem;
}

h2 {
  font-size: 4vw;
  font-weight: 100;
}
h3 {
  font-size: 3vw;
}

.logo {
  position: absolute;
  top: 2cqmin;
  max-height: 10%;
}

#bg {
  height: 100%;
  width: 100%;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

#backBtn {
  position: absolute;
  top: 2cqmin;
  left: 2cqmin;
}

.pageBtn {
  height: 50%;
}

.pdfContainer {
  display: flex;
  justify-content: center;
  width: 96%;
  flex: 1;
  padding: 2vh;
  overflow: hidden;
  align-items: center;
}

@media only screen and (max-device-width: 768px) {
  .pageBtn,
  .hideBtn {
    display: none;
  }
  .pdfContainer {
    padding: 0;
    width: 100%;
    height: 100%;
  }
}

#loading {
  animation: spin 1.5s linear infinite;
  width: 8cqmin;
  height: 8cqmin;
  object-fit: contain;
  filter: invert(0.75) sepia(1) saturate(2) hue-rotate(330deg);

  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: none;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(-360deg);
  }
}

/* select game */
.gameTitle {
  margin: 0;
  text-align: center;
  font-size: 9cqw;
  h2 {
    margin: 0;
  }
}

.inGame {
  margin: 0 0 0 4vmin;
  width: max-content;
  height: 100%;
  writing-mode: vertical-lr;
  text-align: center;
  line-height: 1;
}

button {
  border-radius: 8px;
  border: 2px solid var(--brand-color);
  transition-duration: 0.4s;
  background-color: #fcf5e4;
  font-size: 3vw;
  padding: 1vmin 2vmin;
  font-family: "Bakudai-Regular";
}

@media only screen and (max-device-width: 768px) {
  .gameTitle {
    font-size: 9cqw;
  }
  button {
    font-size: 5.4cqw;
  }
}

.hideBtn {
  height: 50%;
  border: 2px solid transparent;
  background-color: transparent;
  color: transparent;
}
.hideBtn:hover {
  background-color: transparent;
  border-color: transparent;
  color: transparent;
}

button:hover {
  background-color: var(--brand-color);
  border-color: var(--border-color);
  color: white;
}

.selectionContainer {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2vw;
  margin: 2vh 4vw;
}
@media only screen and (max-device-width: 768px) {
  .selectionContainer {
    grid-template-columns: repeat(2, 1fr);
    margin: 2vh 2vw;
  }
}

/* rhymes game */
.highlight {
  color: red;
  text-decoration: underline;
  text-shadow:
    #fff 0 0 0.24rem,
    #fff 0 0 0.24rem,
    #fff 0 0 0.24rem,
    #fff 0 0 0.24rem,
    #fff 0 0 0.24rem;
}
#trackContainer {
  display: flex;
  height: 100%;
  padding: 0px 4vw;
  justify-content: center;
}

.rhymesTrack {
  background-color: rgba(207, 170, 118, 0.4);
  border-left: 2px solid var(--border-color);
  height: 100%;
  flex: 1;
  position: relative;
}

.note {
  font-size: 5vw;
  padding: 1vw;
  position: absolute;
  left: calc(50% - 2.5vw);
  bottom: -7vw;
  animation: moveDown 3s linear infinite;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: rgb(255, 233, 233);
  border-radius: 50%;
}

.user-select-none {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

@keyframes moveDown {
  0% {
    transform: translateY(calc(-100vh + 8vh));
  }
}

#banner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: rgba(0, 0, 0, 0.5);
  color: white;
  padding: 10px;
  text-shadow: none;
  pointer-events: none;
  font-size: 6cqw;
}

/* puzzle game */
#puzzle-wrapper {
  display: flex;
  height: 80%;
}

#puzzle-container {
  overflow-y: scroll;
  -ms-overflow-style: none; /* Internet Explorer 10+ */
  scrollbar-width: none; /* Firefox */
}
#puzzle-container::-webkit-scrollbar {
  display: none; /* Safari and Chrome */
}

#slot-container {
  display: grid;
  height: fit-content;
  max-height: 100%;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(5, 1fr);
  margin: 0 1cqmin 1cqmin 1cqmin;
}

.puzzle-piece {
  height: calc(100% / 5);
  margin: 0 1cqmin 1cqmin 1cqmin;
}

.puzzle-slot {
  width: auto;
  background-color: #fff;
  border: 1px solid grey;
}

#scroll-bar {
  background-color: grey;
  width: 8px;
  position: absolute;
  left: 0;
  border-radius: 4px;
}

#scroll-bar-container {
  width: 8px;
  position: relative;
  background-color: whitesmoke;
  border-radius: 4px;
  display: none;
}

@media only screen and (max-device-width: 768px) {
  #puzzle-wrapper {
    flex-direction: column;
  }
  #puzzle-container {
    overflow-x: scroll;
    width: 100% !important;
    display: inline-block;
    display: -webkit-inline-box;
  }
  #scroll-bar-container {
    height: 8px;
    width: 100%;
  }
  #scroll-bar {
    height: 8px;
    width: auto;
    position: absolute;
    top: 0;
    left: 0;
  }
  #slot-container {
    height: fit-content;
    max-height: 50%;
  }
  #timer {
    font-size: 3cqh;
  }
}

/* matching */
.card {
  width: 20cqmin;
  aspect-ratio: 0.8;
  border: 2px solid var(--border-color);
  display: inline-block;
  margin: 10px;
  text-align: center;
  cursor: pointer;
  border-radius: 1cqmin;
  perspective: 1000px;
  transition: transform 0.5s;
  background-color: var(--brand-color);
  position: absolute;
  backface-visibility: hidden;

  align-content: center;
  font-size: 4cqmin;
  white-space: pre-line;
}

.matched {
  border: 4px solid var(--border-color);

  box-sizing: border-box;
  -moz-box-sizing: border-box;
  -webkit-box-sizing: border-box;
}

.back {
  background-color: var(--border-color);
}

.flip {
  transform: rotateY(180deg);
}

@media only screen and (max-device-width: 768px) {
  .matching-card {
    writing-mode: vertical-lr;
    font-size: 7cqw !important;
  }
}

/* connect */
.connectSelection {
  margin-bottom: 1cqmin;

  width: 100%;
  border: 2px solid var(--border-color);
  box-sizing: border-box;
  border-radius: 8px;

  display: flex;
  justify-content: center;
  align-items: center;
}

.connectSelectionPic {
  height: 100%;
  width: 100%;
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
}

.connectSelection:hover {
  background-color: #ffb70271;
}

.connectColumn {
  width: 40%;
  height: 100%;
}

@media only screen and (max-device-width: 768px) {
  .connectSelection {
    flex-direction: column;
    font-size: 2.5cqh !important;
    text-align: center;
    div {
      font-size: 2cqh !important;
    }
  }
}

/* matching */
.matching-board {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  height: 100%;
  width: 100%;
  padding: 2cqmin;
  box-sizing: border-box;
  gap: 2cqmin;
  justify-content: center;
  align-items: center;
}

.matching-card {
  background-color: var(--brand-color);
  /* height: 40%; */
  /* aspect-ratio: 3 / 2; */
  font-size: 3.8cqw;
  border-radius: 2cqmin;
  border: 2px solid var(--border-color);
  box-sizing: border-box;
  white-space: pre-line;
  overflow: hidden;
  display: inline-block;
}

/* ticTacToe */
table {
  border-collapse: collapse;
  width: 45cqmin;
  height: 45cqmin;
  margin: 0 auto;
}
td {
  border: 1px solid black;
  text-align: center;
  /* font-size: 12cqmin; */
  cursor: pointer;
}
td:hover {
  background-color: #fadada75;
}
td.done:hover {
  background-color: unset;
}

#choice-container {
  display: none;
  width: 100%;
  justify-content: space-around;
}

#choice-container button {
  width: 30%;
}
