@import url('https://fonts.googleapis.com/css2?family=Work+Sans:wght@400;500;600;700&display=swap');

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

*:focus {
  outline: none;
  box-shadow: 0 0 0 0.8rem rgba(141, 139, 217, 0.5);
  transition: all 0.2s ease;
}

html {
  font-size: 62.5%;
}

body {
  font-family: 'Work Sans', sans-serif;
  line-height: 1;
  font-weight: 400;
  background: linear-gradient(135deg, #726bea, #4f46e5);
  min-height: 100vh;
  padding: 10rem 0;
  color: #fff;
  transition: background 0.5s ease;
}

.container {
  width: 90vw;
  margin: 0 auto;
}

/* ********************************* */
/* HEADER */
/* ********************************* */

header {
  border-bottom: #fff 5px solid;
  position: relative;
  display: flex;
  flex-direction: column;
}

svg {
  margin-right: 0.4rem;
  opacity: 0.7;
}

.fa-circle-question {
  margin-right: 0;
}

.between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6.4rem;
}

.btn {
  padding: 1.2rem 2.4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 2.4rem;

  background-color: #0cd1a2;
  color: #fff;
  border: none;
  outline: none;
  border-radius: 5rem;
  font-weight: 700;
  transition: all 0.2s ease-in-out;
}

.btn svg {
  width: 2.4rem;
  margin-right: 1.2rem;
}

.btn:hover,
.btn:active {
  background-color: #0bbc92;
}

.wide {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.2rem;
  font-size: 2.4rem;
  color: #fff;
}

.wide .start,
.wide .end {
  height: 5rem;
  width: 5rem;
  display: grid;
  place-content: center;

  background-color: #fff;
  color: #0cd1a2;
  padding: 1.2rem;
  border-radius: 20px;
  font-weight: 600;
}

a {
  color: #fff;
  text-decoration: none;
  font-size: 5rem;
  margin-left: 2.4rem;
}

.primary-heading {
  width: 100%;
  display: flex;
  justify-content: center;
  gap: 2.4rem;
  font-size: 3.6rem;
  color: #fff;
  height: 7rem !important;
  overflow: hidden;
  margin-bottom: 12.8rem;
}

.string {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  text-align: center;
  animation: move 5s infinite;
  color: #0cd1a2;
}

.top {
  color: #fff;
}

.number {
  background: #eee;
  color: #473fce;
  font-size: 5.2rem;
  font-weight: 700;
  width: 20rem;
  padding: 2.4rem 0rem;
  text-align: center;
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translate(-50%, 50%);
  border-radius: 12rem;
}

/* ********************************* */
/* MAIN */
/* ********************************* */

main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12.8rem 0;
  gap: 9.6rem;
}

.left {
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
}

.right {
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  text-align: center;

  color: #fff;
  font-size: 3.2rem;
  font-weight: 500;
}

.guess {
  display: block;
  font-size: 2.4rem;
  width: 50%;
  border: 4px solid #0bbc92;
  background-color: #dcdafa;
  outline: none;
  padding: 2.4rem 4.8rem;
  margin-bottom: 2.4rem;
  border-radius: 12rem;
  text-align: center;
}

.check {
  display: block;
  width: 50%;
  padding: 2.4rem 4.8rem;
}

.message {
  margin-bottom: 6.4rem;
}

.label-score {
  margin-bottom: 2.4rem;
}

/* ********************************* */
/* ANIMATION */
/* ********************************* */

@keyframes move {
  25% {
    transform: translatey(-7.2vmin);
    opacity: 1;
  }
  50% {
    transform: translatey(-15vmin);
  }
  75% {
    transform: translatey(-22vmin);
  }
}

/* ********************************* */
/* QUERIES */
/* ********************************* */

@media (max-width: 1100px) {
  html {
    font-size: 40%;
  }
}

@media (max-width: 800px) {
  .container {
    width: 80vw;
  }
  .primary-heading {
    order: 1;
    margin-bottom: 6.4rem;
  }
  .between {
    order: 2;
    margin-bottom: 12.8rem;
    flex-direction: column-reverse;
    gap: 4.8rem;
  }
  main {
    flex-direction: column;
    padding-bottom: 0;
  }
}

@media (max-width: 600px) {
  .primary-heading {
    font-size: 2.5rem;
  }
}

/* ********************************* */
/* CHANGING THEME WHEN YOU WIN OR LOST */
/* ********************************* */

.success {
  background: linear-gradient(135deg, #3ddab5, #0cd1a2);
  color: #444;
}

.success .btn {
  background-color: #4f46e5;
}

.success .btn:hover,
.success .btn:active {
  background-color: #473fce;
}

.success .wide .start,
.success .wide .end {
  color: #4f46e5;
}

.success .string {
  color: #4f46e5;
}

.success .guess {
  border: 4px solid #4f46e5;
}

.success .number {
  color: #0cd1a2;
}

/* When you lost */

.lost {
  background: linear-gradient(135deg, #da3d3d, #d10c0c);
  color: #444;
}

.lost .btn {
  background-color: #9590ef;
}

.lost .btn:hover,
.lost .btn:active {
  background-color: #847eed;
}

.lost .wide .start,
.lost .wide .end {
  color: #9590ef;
}

.lost .string {
  color: #9590ef;
}

.lost .guess {
  border: 4px solid #9590ef;
}

.lost .number {
  color: #847eed;
}
