@import "reset.css";

@font-face {
    font-family: 'Peachy Keen';
    src: url('../fonts/peachy-keen-jf-webfont.woff2') format('woff2'),
         url('../fonts/peachy-keen-jf-webfont.woff') format('woff');
    font-weight: normal;
    font-style: normal;
}

body {
  background-image: url('../img/background.png');
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
  overflow-x: hidden;
}
.generator,
.solver {
  display: none;
}
.solver {
  user-select: none;
}
.board {
  position: absolute;
  top: 50%;
  /* left: 50%; */
  /* translate: -50% -50%; */
  translate: 0 -50%;
  width: 800px;
  height: 800px;
  background-image: url('../img/board.png');
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
  padding: 131px 130px;
  filter: drop-shadow(0px 0px 5px rgba(0, 0, 0, 0.8));
}
.solver .board {
  right: 80px;
  left: auto;
  translate: 0 -50%;
}

.text,
.text:disabled {
  color: #222;
}
.board .text {
  position: absolute;
  border: none;
  background: none;
  border-radius: 10px;
  width: 50%;
  height: 70px;
  font-family: 'Impact';
  font-size: 60px;
  letter-spacing: 1px;
  text-align: center;
}

.board .text:nth-child(1) {
  top: 40px;
  left: 50%;
  translate: -50% 0;
}
.board .text:nth-child(2) {
  top: 50%;
  right: 75px;
  translate: 50% -50%;
  rotate: 90deg;
}
.board .text:nth-child(3) {
  bottom: 40px;
  left: 50%;
  translate: -50% 0;
  rotate: 180deg;
}
.board .text:nth-child(4) {
  top: 50%;
  left: 75px;
  translate: -50% -50%;
  rotate: 270deg;
}


.generator .cards {
  position: absolute;
  top: 50%;
  /* left: 50%; */
  left: 131px;
  /* translate: -50% -50%; */
  translate: 0 -50%;
  width: 540px;
  height: 538px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 11px;
}
.solver .cards {
  position: fixed;
  display: block;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.generator .cards {
  pointer-events: none;
}
.card {
  position: relative;
  width: 263px;
  height: 263px;
  background-image: url('../img/card-front.png');
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
  border-radius: 30px;
  box-shadow: 0px 0px 5px 0px rgba(0,0,0,0.5);
  pointer-events: all;
  transition: rotate 0.5s;
  transition-duration: 300ms;
}
.card.incorrect::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: rgba(255, 0, 0, 0.2);
  border-radius: 25px;
}
.card:nth-child(n+5) {
  /* position: absolute; */
  /* top: 50%; */
  /* left: calc(100% + 200px); */
  /* translate: 0 -50%; */
  /* margin-left: 150px; */
}
.generator .card:nth-child(1) {
  grid-column-start: 1;
  grid-row-start: 1;
}
.generator .card:nth-child(2) {
  grid-column-start: 2;
  grid-row-start: 1;
  margin-right: 100px;
}
.generator .card:nth-child(3) {
  grid-column-start: 1;
  grid-row-start: 2;
}
.generator .card:nth-child(4) {
  grid-column-start: 2;
  grid-row-start: 2;
  margin-right: 100px;
}
.generator .card:nth-child(5) {
  grid-column-start: 3;
  grid-row-start: 1;
}
.generator .card:nth-child(6) {
  grid-column-start: 3;
  grid-row-start: 2;
}
.generator .card:nth-child(7) {
  grid-column-start: 4;
  grid-row-start: 1;
}
.generator .card:nth-child(8) {
  grid-column-start: 4;
  grid-row-start: 2;
}
.generator .card:nth-child(9) {
  grid-column-start: 5;
  grid-row-start: 1;
}
.generator .card:nth-child(10) {
  grid-column-start: 5;
  grid-row-start: 2;
}
.generator .card:nth-child(5)::before {
  content: "Filthy Traitors";
  position: absolute;
  width: 100%;
  top: -50px;
  font-family: 'Peachy Keen';
  font-size: 28px;
  letter-spacing: 1px;
  text-align: center;
  background: #FFF;
  border-radius: 30px;
  color: #444;
  box-shadow: 0px 0px 5px 0px rgba(0,0,0,0.5);
}

.card .text {
  position: absolute;
  border: none;
  background: none;
  border-radius: 10px;
  width: 70%;
  height: 30px;
  font-family: 'Peachy Keen';
  font-size: 28px;
  letter-spacing: 1px;
  text-align: center;
}

.card .text:nth-child(1) {
  top: 10px;
  left: 50%;
  translate: -50% 0;
}
.card .text:nth-child(2) {
  top: 50%;
  right: 24px;
  translate: 50% -50%;
  rotate: 90deg;
}
.card .text:nth-child(3) {
  bottom: 10px;
  left: 50%;
  translate: -50% 0;
  rotate: 180deg;
}
.card .text:nth-child(4) {
  top: 50%;
  left: 24px;
  translate: -50% -50%;
  rotate: 270deg;
}
.card .text:nth-child(4) {
  top: 50%;
  left: 24px;
  translate: -50% -50%;
  rotate: 270deg;
}

.solver .cards .card {
  position: absolute;
  top: 0;
  left: 0;
  translate: 0;
}
.solver .cards .card:nth-child(1) {
  top: 150px;
  left: 150px;
}
.solver .cards .card:nth-child(2) {
  top: 50px;
  left: 500px;
}
.solver .cards .card:nth-child(3) {
  top: 350px;
  left: 650px;
}
.solver .cards .card:nth-child(4) {
  top: 450px;
  left: 50px;
}
.solver .cards .card:nth-child(5) {
  top: 650px;
  left: 450px;
}

.generator .board > .text:hover,
.board > .text:focus {
  background: #638732;
  outline: none;
}
.generator .card > .text:hover,
.card > .text:focus {
  background: #EEE;
  outline: none;
}

/* These have to be separate declarations */
.board .text::placeholder {
  color: #7CA93F;
  opacity: 1; /* Firefox */
}
.board .text::-ms-input-placeholder { /* Microsoft Edge */
 color: #7CA93F;
}
.card .text::placeholder {
  color: #CCC;
  opacity: 1; /* Firefox */
}
.card .text::-ms-input-placeholder { /* Microsoft Edge */
 color: #CCC;
}

.button {
  position: absolute;
  background: #7CA93F;
  box-shadow: 0px 0px 5px 0px rgba(0,0,0,0.5);
  font-family: 'Peachy Keen';
  font-size: 28px;
  letter-spacing: 1px;
  text-align: center;
  border-radius: 9999px;
  padding: 10px 60px 10px 20px;
  color: #FFF;
  border: 4px solid #FFF;
  cursor: pointer;
  z-index: 1;
  user-select: none;
}
.button::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 14px;
  translate: 0 -50%;
  width: 30px;
  height: 30px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center center;
}
.button.disabled {
  opacity: 0.7;
  cursor: not-allowed;
}
.save {
  right: 40px;
  bottom: 40px;
}
.save::after {
  background-image: url('../img/files.svg');
}
.save-popup {
  opacity: 0;
  background: #4BB543;
  transition-duration: 100ms;
  z-index: 0;
  right: 40px;
  bottom: 40px;
}
.save-popup.visible {
  bottom: 120px;
  opacity: 1;
}
.save-popup::after {
  background-image: url('../img/check-mark.svg');
}
.traitor {
  top: 40px;
  right: 40px;
  background: orangered;
}
.traitor::after {
  background-image: url('../img/add.svg');
}
.check-solution {
  right: 40px;
  bottom: 40px;
  background-color: deepskyblue;
}
.check-solution::after {
  background-image: url('../img/question.svg');
}
.answer {
  opacity: 0;
  background: #4BB543;
  transition-duration: 100ms;
  z-index: 0;
  right: 40px;
  bottom: 40px;
}
.answer.visible {
  bottom: 120px;
  opacity: 1;
}
.answer.correct::before {
  content: "Correct!";
}
.answer.incorrect {
  background: orangered;
}
.answer.incorrect::before {
  content: "Incorrect!";
}
.answer.correct::after {
  background-image: url('../img/check-mark.svg');
}
.answer.incorrect::after {
  background-image: url('../img/wrong.svg');
}
.generator .save:hover {
  background: #95C257;
}
.new {
  position: absolute;
  bottom: 40px;
  left: 40px;
  background: #7CA93F;
  box-shadow: 0px 0px 5px 0px rgba(0,0,0,0.5);
  font-family: 'Peachy Keen';
  font-size: 28px;
  letter-spacing: 1px;
  text-align: center;
  border-radius: 9999px;
  padding: 0;
  color: #FFF;
  border: 4px solid #FFF;
  cursor: pointer;
  z-index: 1;
}
.new a {
  display: block;
  text-decoration: none;
  color: #FFF;
  padding: 10px 60px 10px 20px;
}
.new::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 14px;
  translate: 0 -50%;
  width: 30px;
  height: 30px;
  background: url('../img/page.svg') no-repeat center center;
  background-size: contain;
}

.solver input.text {
  user-select: none !important;
  pointer-events: none;
}

.slots {
  position: absolute;
  top: 50%;
  left: auto;
  right: calc(80px + 130px);
  translate: 0 -50%;
  width: 540px;
  height: 538px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 11px;
  /* z-index: 2; */
}
.slots:not(.active) {
  pointer-events: none;
}
.slot {
  border-radius: 30px;
}
.slots.active .slot.over {
  opacity: 0.1;
}
.slots.active .slot.hovering:not(.over) {
  background: red;
  opacity: 0.1;
}

.rotator {
  display: none;
  position: absolute;
  top: 50%;
  left: 50%;
  translate: -50% -50%;
  background: url('../img/rotate-right.svg') no-repeat center center;
  background-size: 50%;
  width: 87px;
  height: 87px;
  opacity: 0.5;
  cursor: pointer;
}
.rotator:hover {
  opacity: 1;
}
.slotted .rotator {
  display: block;
}

.fingies {
  position: absolute;
  width: 200px;
  height: 255px;
  background: url('../img/fingies.png') no-repeat center bottom -50px;
  background-size: contain;
  bottom: 0;
  left: 50%;
  translate: -50% 0;
}


@media (max-width: 1500px) {
  .generator .board,
  .generator .cards {
    left: 40px;
    translate: 0 -50%;
  }
  .generator .cards {
    left: 170px;
  }
}
@media (max-width: 1200px) {
  .generator .board {
    width: 650px;
    height: 650px;
  }
  .generator .cards {
    left: 145px;
    width: 440px;
    height: 438px;
  }
  .generator .card {
    width: 213px;
    height: 213px;
  }
  .board .text {
    font-size: 50px;
  }
  .card .text {
    font-size: 24px;
  }
  .save {
    bottom:  10px;
    right: 10px;
  }
  .traitor {
    top: 10px;
    right: 10px;
  }
  /* .card:nth-child(5) {
    left: calc(100% + 130px);
  } */
}
@media (max-width: 1024px) {
  .generator {
    height: 100%;
    margin: 0 0 150px;
  }
  .generator .board {
    width: 90%;
    height: 0;
    padding: 90% 0 0;
    left: 5%;
    top: 5%;
    translate: 0;
  }
  .generator .cards {
    width: 90%;
    height: 0;
    padding: 90% 0 0;
    left: 5%;
    top: 5%;
    translate: 0;
    grid-template-columns: repeat(3, 1fr) !important;
  }
  .generator .card {
    width: 32.5%;
    height: 32.5%;
    position: absolute;
    left: 16.5%;
    top: 16.5%;
  }
  .generator .cards .card:nth-child(1) {
    left: 16.5%;
    top: 16.5%;
    grid-column-start: auto;
    grid-row-start: auto;
    margin: 0;
  }
  .generator .cards .card:nth-child(2) {
    left: auto;
    top: 16.5%;
    right: 16.5%;
    grid-column-start: auto;
    grid-row-start: auto;
    margin: 0;
  }
  .generator .cards .card:nth-child(3) {
    left: 16.5%;
    top: 51%;
    grid-column-start: auto;
    grid-row-start: auto;
    margin: 0;
  }
  .generator .cards .card:nth-child(4) {
    left: auto;
    top: 51%;
    right: 16.5%;
    grid-column-start: auto;
    grid-row-start: auto;
    margin: 0;
  }
  .generator .cards .card:nth-child(5) {
    /* top: calc(100% + 80px); */
    /* left: 50%; */
    /* translate: -50% 0; */
    width: 32.5%;
    height: 32.5%;
    grid-column-start: auto;
    grid-row-start: auto;
  }
  .generator .cards .card:nth-child(n+5) {
    position: relative;
    width: 100%;
    height: 0;
    padding-top: 100%;
    grid-column-start: auto;
    grid-row-start: auto;
    left: 0;
  }
  .save {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    border: 0;
    border-radius: 0;
  }
  .save-popup.visible {
    z-index: 999;
    bottom: 80px;
  }
  .check-solution,
  .traitor,
  .answer {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: auto;
    border: 0;
    border-radius: 0;
  }
  .answer.visible {
    z-index: 999;
    top: 80px;
    bottom: auto;
  }

  .new {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    border: 0;
    border-radius: 0;
  }
}

@media (max-width: 600px) {
  .generator .board,
  .generator .cards {
    width: 100%;
    padding-top: 100%;
    top: 62px;
    left: 0;
    background-size: 110%;
  }
  .generator .board .text {
    height: 40px;
    font-size: 30px;
  }
  .generator .board .text:nth-child(1) {
    top: 10px;
  }
  .generator .board .text:nth-child(2) {
    right: 25px;
  }
  .generator .board .text:nth-child(3) {
    bottom: 10px;
  }
  .generator .board .text:nth-child(4) {
    left: 25px;
  }
  .generator .cards .card,
  .generator .cards .card:nth-child(5) {
    width: 36%;
    height: 36%;
    border-radius: 15px;
  }
  .generator .cards .card:nth-child(1) {
    left: 13%;
    top: 13%;
  }
  .generator .cards .card:nth-child(2) {
    left: auto;
    top: 13%;
    right: 13%;
  }
  .generator .cards .card:nth-child(3) {
    left: 13%;
    top: 51%;
  }
  .generator .cards .card:nth-child(4) {
    left: auto;
    top: 51%;
    right: 13%;
  }

  .generator .cards .card:nth-child(n+5) {
    position: relative;
    width: 100%;
    height: 100%;
    left: 0;
    top: 0;
  }
  .generator .card:nth-child(5)::before {
    content: "Traitors";
    width: 100%;
    left: 0%;
    top:  0;
    translate: 0 -100%;
    font-size: 18px;
  }
  .generator .card .text {
    font-size: 17px;
  }
  .generator .card .text:nth-child(1) {
    top: 0;
  }
  .generator .card .text:nth-child(2) {
    right: 14px;
  }
  .generator .card .text:nth-child(3) {
    bottom: 0;
  }
  .generator .card .text:nth-child(4) {
    left: 14px;
  }
}



@media (max-width: 1800px) {
  .solver .board {
    width: 700px;
    height: 700px;
  }
  .solver .board .text {
    font-size: 50px;
  }
  .solver .slots {
    width: 470px;
    height: 470px;
    right: 195px;
  }
  .solver .card {
    width: 230px;
    height: 230px;
    border-radius: 25px;
  }
  .solver .cards .card:nth-child(3) {
    left: 380px;
  }
}

@media (max-width: 1440px) {
  .solver .board {
    width: 600px;
    height: 600px;
  }
  .solver .slots {
    width: 405px;
    height: 405px;
    right: 178px;
  }
  .solver .card {
    width: 200px;
    height: 200px;
  }
  .solver .cards .card:nth-child(1) {
    top: 100px;
    left: 100px;
  }
  .solver .cards .card:nth-child(2) {
    top: 50px;
    left: 370px;
  }
  .solver .cards .card:nth-child(3) {
    top: 300px;
    left: 330px;
  }
  .solver .cards .card:nth-child(4) {
    top: 380px;
  }
  .solver .cards .card:nth-child(5) {
    top: 520px;
    left: 230px;
  }
}
@media (min-width: 1025px) and (max-width: 1440px), (max-width: 768px) {
  .solver .board .text {
    font-size: 40px;
  }
  .solver .card .text {
    font-size: 22px;
  }
  .solver .board .text:nth-child(1) {
    top: 20px;
  }
  .solver .board .text:nth-child(2) {
    right: 55px;
  }
  .solver .board .text:nth-child(3) {
    bottom: 20px;
  }
  .solver .board .text:nth-child(4) {
    left: 55px;
  }
}
@media (max-width: 1024px) {
  .solver .board {
    position: relative;
    width: 90%;
    height: 0;
    padding: 90% 0 0;
    top: auto;
    left: auto;
    right: auto;
    translate: 0;
    margin: 40px auto 0;
  }
  .solver .slots {
    width: 90%;
    height: 0;
    padding: 90% 0 0;
    top: 0;
    left: 50%;
    translate: -50% 0;
    right: auto;
    margin: 40px auto 0;
  }
  .solver .cards {
    position: absolute;
    width: 100%;
    height: 0;
    padding: 100% 0 0;
  }
  .solver .cards .card,
  .solver .cards .card:nth-child(1n) {
    top: 100%;
    right: auto;
    bottom: auto;
    left: auto;
    width: 29.5%;
    height: 29.5%;
  }
  .solver .cards .card:not(.slotted):nth-child(3n+1) {
    top: 130%;
    left: 0;
  }
  .solver .cards .card:not(.slotted):nth-child(3n+2) {
    top: 130%;
    left: 50%;
    translate: -50% 0;
  }
  .solver .cards .card:not(.slotted):nth-child(3n+3) {
    top: 130%;
    left: auto;
    right: 0;
  }
  .solver .cards .card:not(.slotted):nth-child(1) {
    top: 100%;
  }
  .solver .cards .card:not(.slotted):nth-child(2) {
    top: 100%;
  }
  .solver .cards .card:not(.slotted):nth-child(3) {
    top: 100%;
  }
  .solver .cards .card:not(.slotted) {
    /* rotate: 0deg !important; */
  }
  .solver .slots .slot {
    position: absolute;
    width: 33%;
    height: 33%;
  }
  .solver .slots .slot:nth-child(1) {
    top: 16.3%;
    left: 16.3%;
  }
  .solver .slots .slot:nth-child(2) {
    top: 16.3%;
    right: 16.3%;
  }
  .solver .slots .slot:nth-child(3) {
    top: 51%;
    left: 16.3%;
  }
  .solver .slots .slot:nth-child(4) {
    top: 51%;
    right: 16.3%;
  }
  .solver .slots .slot .card {
    width: 100%;
    height: 100%;
  }
}


@media (max-width: 600px) {
  .solver {
    padding-top: 62px;
  }
  .solver .board,
  .solver .cards {
    width: 100%;
    padding-top: 100%;
    top: 0;
    left: 0;
    background-size: 110%;
    margin: 0;
  }
  .solver .slots {
    width: 100%;
    height: 0;
    padding: 100% 0 0;
    top: 62px;
    left: 50%;
    translate: -50% 0;
    right: auto;
    margin: 0;
  }
  .solver .board .text {
    height: 40px;
    font-size: 30px;
  }
  .solver .board .text:nth-child(1) {
    top: 10px;
  }
  .solver .board .text:nth-child(2) {
    right: 25px;
  }
  .solver .board .text:nth-child(3) {
    bottom: 10px;
  }
  .solver .board .text:nth-child(4) {
    left: 25px;
  }
  .solver .cards .card,
  .solver .slots .slot,
  .solver .cards .card:nth-child(n) {
    width: 36%;
    height: 36%;
    border-radius: 15px;
  }
  .solver .slots .slot:nth-child(1) {
    top: 13%;
    left: 13%;
  }
  .solver .slots .slot:nth-child(2) {
    top: 13%;
    right: 13%;
  }
  .solver .slots .slot:nth-child(3) {
    bottom: 13%;
    left: 13%;
  }
  .solver .slots .slot:nth-child(4) {
    bottom: 13%;
    right: 13%;
  }
  .solver .card .text {
    font-size: 17px;
  }
  .solver .card .text:nth-child(1) {
    top: 0;
  }
  .solver .card .text:nth-child(2) {
    right: 14px;
  }
  .solver .card .text:nth-child(3) {
    bottom: 0;
  }
  .solver .card .text:nth-child(4) {
    left: 14px;
  }

  .solver .cards .card:not(.slotted):nth-child(1) {
    left: 5%;
    translate: 0;
  }
  .solver .cards .card:not(.slotted):nth-child(2) {
    top: auto;
    right: 5%;
    left: auto;
    translate: 0;
  }
  .solver .cards .card:not(.slotted):nth-child(3) {
    top: 140%;
    right: auto;
    left: 5%;
    translate: 0;
  }
  .solver .cards .card:not(.slotted):nth-child(4) {
    top: 140%;
    right: 5%;
    left: auto;
    translate: 0;
  }
  .solver .cards .card:not(.slotted):nth-child(5) {
    top: 180%;
    left: 5%;
    right: auto;
    translate: 0;
  }
  .solver .cards .card:not(.slotted):nth-child(6) {
    top: 180%;
    right: 5%;
    left: auto;
    translate: 0;
  }

  .rotator {
    width: 35%;
    height: 35%;
  }
}
