@import url("https://fonts.googleapis.com/css2?family=Rubik:ital,wght@0,300..900;1,300..900&family=Varela+Round&display=swap");

:root {
  --font-family: "Varela Round", sans-serif;
  --white-color: rgb(251, 251, 251);
  --primary-color-2: rgba(251, 251, 251, 0.2);
  --primary-color-4: rgba(251, 251, 251, 0.4);
  --primary-color-6: rgba(251, 251, 251, 0.6);
  --antiquewhite-color: rgb(250, 235, 215);
  --antiquewhite-color-8: rgb(250, 235, 215, 0.8);
  --moruga-color: rgb(208, 59, 62);
  --coral-rose-color: rgb(242, 120, 88);
  --text-color-9: rgba(59, 59, 59, 0.9);
  --text-color-7: rgba(59, 59, 59, 0.7);
  --border-bottom: rgba(57, 57, 57, 0.2);
  --placeholder-color: rgba(231, 111, 81, 0.6);
  --shadow-color: rgba(3, 83, 98, 0.3);
}

* {
  padding: 0;
  margin: 0;
  box-sizing: border-box;
  font-family: var(--font-family);
  color: var(--text-color-9);
}

/* Styles for ::placeholder in different browsers*/
::-webkit-input-placeholder {
  /* Chrome/Opera/Safari */
  color: var(--placeholder-color);
  font-size: 110%;
  letter-spacing: 1px;
}

::-moz-placeholder {
  /* Firefox 19+ */
  color: var(--placeholder-color);
  font-size: 110%;
  letter-spacing: 1px;
}

:-ms-input-placeholder {
  /* IE 10+ */
  color: var(--placeholder-color);
  font-size: 110%;
  letter-spacing: 1px;
}

:-moz-placeholder {
  /* Firefox 18- */
  color: var(--placeholder-color);
  font-size: 110%;
  letter-spacing: 1px;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.hidden {
  display: none;
}

header {
  display: flex;
  position: fixed;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  z-index: 100;
  color: var(--text-color-9);
  background-color: var(--primary-color-4);
  padding: 0.5rem 1.5rem;
  border-bottom: 1px solid var(--border-bottom);
}

#logo {
  display: flex;
  position: relative;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;

  text-transform: uppercase;
  background: linear-gradient(
    to right,
    var(--moruga-color) 0%,
    var(--coral-rose-color) 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

#logo > h2 {
  font-size: 250%;
  line-height: 1;
  font-family: "Rubik", sans-serif;
}

#logo > img {
  width: 40px;
  height: auto;
  object-fit: cover;
  display: block;
}

#responsive-menu-icon {
  color: var(--text-color-9);
}

header a,
.lifehack-tags a,
.slogan a {
  text-decoration: none;
  color: inherit;
}

#menu {
  list-style-type: none;
  text-align: end;
}

#menu > li {
  padding: 0.5rem 0 0.5rem 1rem;
}

#menu a:hover {
  cursor: pointer;
  border-bottom: 2px solid var(--text-color-9);
}

.active {
  border-bottom: 2px solid var(--text-color-9);
}

#menu-list {
  display: none;
  position: absolute;
  width: 100dvw;
  top: 100%;
  left: 0%;
  color: var(--text-color-9);
  border-bottom: 1px solid var(--border-bottom);
}

#responsive-menu:checked ~ #menu-list {
  display: flex;
  height: 100dvh;
  justify-content: flex-end;
  padding-right: 1.5rem;
  background-color: var(--primary-color-4);
}

#responsive-menu {
  display: none;
}

.responsive-menu-label {
  font-size: 200%;
}

.responsive-menu-label:hover {
  cursor: pointer;
}

#menu-user-icon {
  display: flex;
  gap: 1rem;
  align-items: center;
}

#user-icon-container {
  width: 35px;
  height: 35px;
  background-color: var(--text-color-9);
  border-radius: 50%;
}

#user-icon {
  font-size: 150%;
  text-align: center;
  vertical-align: middle;
  line-height: 35px;
  color: var(--white-color);
}

main {
  display: flex;
  flex-direction: column;
  flex: 1 0 auto;
}

/* Landing page */
#main-landing-container {
  position: relative;
  background: url("../images/pineapple.webp") no-repeat center bottom / cover;
  height: 100dvh;
  width: 100dvw;
  overflow: scroll;
}

.tagline {
  position: absolute;
  bottom: 0px;
  right: 0px;
  width: 100dvw;
  background-color: var(--primary-color-6);
  color: var(--white-color);
  padding: 2rem;
  display: flex;
  flex-direction: column;
}

.tagline > h2 {
  font-size: 250%;
}

.tagline > p {
  font-size: 120%;
  padding-bottom: 1rem;
  width: 80%;
}

#username-form {
  display: flex;
  justify-content: left;
  align-items: center;
}

#username-input {
  border-radius: 10px 0 0 10px;
  padding: 1rem;
  font-size: 100%;
}

#username-input:focus {
  outline: none;
}

#bth-username-form {
  border: none;
  letter-spacing: 1px;
  font-size: 120%;
  padding: 1rem;
  background-color: var(--text-color-9);
  border-radius: 0 10px 10px 0;
  color: var(--white-color);
}

#bth-username-form:hover {
  cursor: pointer;
}

#main-rules-container,
#main-game-container,
#main-outcome-container,
#main-champions-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100dvh;
  width: 100dvw;
  background: url("../images/main_background.webp") no-repeat center center /
    cover;
  padding-top: 70px;
  overflow: scroll;
}

/* Rules page */
#main-rules-container {
  gap: 1rem;
}

#main-rules-container > h2 {
  border-bottom: 2px solid var(--text-color-9);
}

#rules-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  border: 2px solid var(--primary-color-4);
  padding: 2rem;
  margin: 1rem;
  border-radius: 10px;
  box-shadow: 5px 5px 0px var(--shadow-color);
  width: 300px;
  background-color: var(--antiquewhite-color);
}

.rules-img {
  width: 100px;
  height: 100px;
  background-color: var(--text-color-7);
  border-radius: 50%;
}

.rules-icon-big {
  position: relative;
  left: 25%;
  top: 25%;
  font-size: 300%;
  color: var(--antiquewhite-color);
}

#word-icon-big {
  left: 20%;
}

.rules-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

#rules-container p {
  text-align: justify;
  letter-spacing: 1px;
  margin-top: 0.5rem;
}

.rules-row {
  display: flex;
  gap: 1rem;
}

.rules-left-board {
  display: flex;
  align-items: center;
  padding-right: 0.5rem;
  border-right: 2px solid var(--border-bottom);
}

.vertical-text {
  writing-mode: vertical-rl;
  transform: scale(-1);
}

#game-level-form {
  display: flex;
  flex-direction: row;
  justify-content: center;
  border-radius: 10px;
}

#complexity-list {
  outline: 0;
  color: var(--text-color-9);
  font-size: 110%;
  padding: 1rem;
  border-radius: 10px 0 0 10px;
  border: 1px solid var(--primary-color-2);
  background-color: var(--white-color);
}

#complexity-list option:checked {
  background-color: var(--antiquewhite-color);
}

#btn-game-level-form {
  background-color: var(--text-color-9);
  border: none;
  border-radius: 0 10px 10px 0;
  color: var(--white-color);
  padding: 0 2rem;
  font-size: 110%;
}

#complexity-list:hover,
#complexity-list:focus,
#btn-game-level-form:hover {
  cursor: pointer;
}

/* Game page */
#life-container {
  display: grid;
  grid-template-columns: repeat(5, 50px);
  grid-template-rows: repeat(2, 50px);
  gap: 0.5rem;
  padding: 1rem;
  margin-bottom: 0.5rem;
  justify-content: center;
}

.life {
  justify-self: center;
  width: 50px;
  height: 50px;
  margin: 0.2rem;

  /* Square shape */
  background: linear-gradient(145deg, #ffffff, #c1c3c6);
  border-radius: 15%;
  box-shadow: 5px 5px 0px var(--shadow-color);
}

.hidden-life:empty {
  background-image: none;
  background-color: #418c9f;
}

#letter-container {
  background-color: var(--antiquewhite-color-8);
  padding: 1rem;
  display: flex;
  width: 100%;
  justify-content: center;
}

.letter {
  width: 40px;
  height: 40px;
  border-radius: 15%;
  border: 3px solid #2e6072aa;
  margin: 0.1rem;
  background-color: whitesmoke;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 200%;
}

#alphabet-container {
  padding: 1rem;
  margin-bottom: 0.5rem;
  display: grid;
  grid-template-columns: repeat(6, 40px);
  grid-template-rows: repeat(5, 40px);
  gap: 0.5rem;
  grid-template-areas:
    "alphabet-btnA alphabet-btnB alphabet-btnC alphabet-btnD alphabet-btnE alphabet-btnF"
    "alphabet-btnG alphabet-btnH alphabet-btnI alphabet-btnJ alphabet-btnK alphabet-btnL"
    "alphabet-btnM alphabet-btnN alphabet-btnO alphabet-btnP alphabet-btnQ alphabet-btnR"
    "alphabet-btnS alphabet-btnT alphabet-btnU alphabet-btnV alphabet-btnW alphabet-btnX"
    ". . alphabet-btnY alphabet-btnZ . .";
  justify-content: center;
}

#btn-A {
  grid-area: alphabet-btnA;
}
#btn-B {
  grid-area: alphabet-btnB;
}
#btn-C {
  grid-area: alphabet-btnC;
}
#btn-D {
  grid-area: alphabet-btnD;
}
#btn-E {
  grid-area: alphabet-btnE;
}
#btn-F {
  grid-area: alphabet-btnF;
}
#btn-G {
  grid-area: alphabet-btnG;
}
#btn-H {
  grid-area: alphabet-btnH;
}
#btn-I {
  grid-area: alphabet-btnI;
}
#btn-J {
  grid-area: alphabet-btnJ;
}
#btn-K {
  grid-area: alphabet-btnK;
}
#btn-L {
  grid-area: alphabet-btnL;
}
#btn-M {
  grid-area: alphabet-btnM;
}
#btn-N {
  grid-area: alphabet-btnN;
}
#btn-O {
  grid-area: alphabet-btnO;
}
#btn-P {
  grid-area: alphabet-btnP;
}
#btn-Q {
  grid-area: alphabet-btnQ;
}
#btn-R {
  grid-area: alphabet-btnR;
}
#btn-S {
  grid-area: alphabet-btnS;
}
#btn-T {
  grid-area: alphabet-btnT;
}
#btn-U {
  grid-area: alphabet-btnU;
}
#btn-V {
  grid-area: alphabet-btnV;
}
#btn-W {
  grid-area: alphabet-btnW;
}
#btn-X {
  grid-area: alphabet-btnX;
}
#btn-Y {
  grid-area: alphabet-btnY;
}
#btn-Z {
  grid-area: alphabet-btnZ;
}

.alphabet-button {
  justify-self: center;
  border: none;
  background-color: rgb(4, 109, 130);
  width: 40px;
  height: 40px;
  margin: 5px;
  text-align: center;
  color: #d6f1fa;
  font-size: 150%;
  border-radius: 15%;
  box-shadow: 5px 5px 0px var(--shadow-color);
  place-self: center;
}

.alphabet-button:active {
  transform: translateY(5px);
}

/* Outcome page */
#game-outcome-card-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  border-radius: 10px;
  box-shadow: 5px 5px 0px var(--shadow-color);
  width: 300px;
  background-color: var(--antiquewhite-color);
  gap: 1.5rem;
  color: var(--text-color-9);
  padding-bottom: 2rem;
}

#game-outcome-image-container {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  overflow: hidden;
  border: 10px solid rgba(255, 255, 255, 0);
  background-color: var(--coral-rose-color);
  z-index: 99;
  box-shadow: 5px 5px 0px var(--shadow-color);
  margin-top: 60px;
}

#game-outcome-image-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#game-outcome-container {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

#stars-bar {
  display: flex;
  gap: 10px;
}

.stars {
  width: 40px;
  height: 40px;
  background-repeat: no-repeat;
  background-position: 50% 50%;
  background-size: contain;
}

.star-off {
  background-image: url("../images/star_off.webp");
}

.star-on {
  background-image: url("../images/star_on.webp");
}

#game-outcome-results-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding-top: 2rem;
  text-align: center;
}

#game-outcome-message {
  color: var(--text-color-9);
  font-style: italic;
}

#game-champion-message > span,
#game-score > span {
  color: var(--moruga-color);
}

#outcome-game-level-form {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.5rem;
}

#outcome-complexity-list {
  outline: 0;
  color: var(--text-color-9);
  font-size: 110%;
  padding: 1rem;
  border-radius: 10px;
  border: 1px solid var(--primary-color-2);
  background-color: var(--white-color);
}

#btn-outcome-game-level-form {
  background-color: var(--text-color-9);
  border: none;
  border-radius: 10px;
  color: var(--white-color);
  padding: 1rem;
  font-size: 110%;
}

#btn-outcome-game-level-form:hover {
  transform: translateY(2px);
}

/* Champions page */
#main-champions-container {
  padding-top: 20px;
}

#champions-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  box-shadow: 5px 5px 0px var(--shadow-color);
  width: 300px;
  background-color: var(--antiquewhite-color);
  gap: 1.5rem;
}

#champions-list-container {
  display: grid;
  grid-template-columns: 1fr 4fr 1fr;
  grid-template-rows: repeat(5, 1fr);
  grid-template-areas:
    "champion-place-1 champion-name-1 champion-score-1"
    "champion-place-2 champion-name-2 champion-score-2"
    "champion-place-3 champion-name-3 champion-score-3"
    "champion-place-4 champion-name-4 champion-score-4"
    "champion-place-5 champion-name-5 champion-score-5";
  margin-bottom: 3rem;
  font-size: 120%;
  gap: 1rem;
}

#champions-list-container > h2 {
  margin: 1rem;
}

#champions-image-container {
  padding-top: 50px;
}

#champions-image-container > img {
  width: 150px;
  height: 131px;
}

.champion-place {
  border-radius: 10px 0 0 10px;
}

.champion-place-circle {
  display: grid;
  justify-items: center;
  align-content: center;
  width: 35px;
  height: 35px;
  background-color: var(--text-color-7);
  border-radius: 50%;
}

.champion-place-text {
  color: var(--white-color);
}

.champion-place,
.champion-score {
  align-self: center;
  color: var(--text-color-7);
}

.champion-name {
  align-self: center;
  color: var(--moruga-color);
}

/* Common styles for 404 & 500 pages */
#main-not-found-container,
#main-server-error-container {
  position: relative;
  background: url("../images/watermelon.webp") no-repeat bottom right / cover;
  height: 100dvh;
  width: 100dvw;
  overflow: hidden;
}

#not-found-greeting,
#server-error-greeting {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  height: fit-content;
  color: var(--text-color-9);
  background-color: var(--primary-color-4);
  margin-top: 5rem;
  padding: 2rem 1.5rem;
  gap: 5px;
}

#nf1,
#se1 {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-size: 120%;
}

#nf1 a,
#se1 a {
  text-decoration: none;
}

#nf1 a:hover,
#se1 a:hover {
  transform: scale(1.05);
}

/* 404 page */
#main-not-found-container,
#main-server-error-container {
  background: url("../images/watermelon.webp") no-repeat bottom right / cover;
}

/* 500 page */
#main-server-error-container {
  background: url("../images/500.webp") no-repeat bottom right / cover;
}

#server-error-h2 {
  text-align: center;
}

/* Amination styles */
.transition-in-out {
  transition: all 0.3s cubic-bezier(0.87, 0, 0.13, 1);
}

.flip {
  transform: scale(0);
  opacity: 0;
}

.swipe {
  transform: translate(-50px, 0px);
  opacity: 0;
}

.swirle {
  transform: rotate(90deg) scale(0);
  opacity: 0;
}

/* Media query: large or landscape phones (576px and up) */
@media screen and (min-width: 576px) {
  /* Header */
  #menu-list {
    border: none;
    display: block;
    position: relative;
    box-shadow: none;
    width: fit-content;
    padding-right: 0.8rem;
    margin: auto 0;
  }

  #menu {
    display: flex;
  }

  .responsive-menu-label {
    display: none;
  }

  /* Landing page */
  #bth-username-form {
    padding: 1rem 3rem;
  }

  /* Rules page */
  #rules-container {
    width: 600px;
  }

  .rules-img {
    display: flex;
  }

  .rules-icons-sm,
  .vertical-text {
    display: none;
  }

  .rules-left-board {
    padding-right: 1rem;
  }

  #life-container {
    grid-template-columns: repeat(5, 80px);
    grid-template-rows: repeat(2, 80px);
    gap: 1rem;
  }

  .life {
    justify-self: center;
    width: 80px;
    height: 80px;
    margin: 0.2rem;
  }

  .letter {
    width: 50px;
    height: 50px;
    font-size: 250%;
    margin: 0.5rem;
  }

  #alphabet-container {
    grid-template-columns: repeat(8, 50px);
    grid-template-rows: repeat(4, 50px);
    gap: 1rem;
    grid-template-areas:
      "alphabet-btnA alphabet-btnB alphabet-btnC alphabet-btnD alphabet-btnE alphabet-btnF alphabet-btnG alphabet-btnH"
      "alphabet-btnI alphabet-btnJ alphabet-btnK alphabet-btnL alphabet-btnM alphabet-btnN alphabet-btnO alphabet-btnP"
      "alphabet-btnQ alphabet-btnR alphabet-btnS alphabet-btnT alphabet-btnU alphabet-btnV alphabet-btnW alphabet-btnX"
      ". . . alphabet-btnY alphabet-btnZ . . .";
  }

  .alphabet-button {
    width: 50px;
    height: 50px;
  }
}

/* Media query: tablets and larger (768px and up) */
@media screen and (min-width: 768px) {
  /* Game page */
  #life-container {
    grid-template-columns: repeat(5, 90px);
    grid-template-rows: repeat(2, 90px);
  }

  .life {
    width: 90px;
    height: 90px;
  }

  .letter {
    width: 70px;
    height: 70px;
  }

  #alphabet-container {
    grid-template-columns: repeat(8, 60px);
    grid-template-rows: repeat(4, 60px);
  }

  .alphabet-button {
    width: 60px;
    height: 60px;
    font-size: 200%;
  }

  /* Outcome page */
  #game-outcome-card-container {
    flex-direction: row;
    width: 600px;
    gap: 2.5rem;
    justify-content: center;
    padding: 2rem;
  }

  #game-outcome-image-container {
    width: 280px;
    height: 280px;
    border-radius: 1rem;
    margin-top: 0px;
  }
}

/* Large devices (laptops and desktops, 992px and up) */
@media screen and (min-width: 992px) {
  /* Header */
  #logo {
    gap: 0.5rem;
  }

  #logo > h2 {
    font-size: 300%;
  }

  #logo > img {
    width: 50px;
  }

  /* Game page */
  #life-container {
    grid-template-columns: repeat(5, 100px);
    grid-template-rows: repeat(2, 100px);
    gap: 2rem;
  }

  .life {
    width: 100px;
    height: 100px;
  }

  .letter {
    width: 90px;
    height: 90px;
  }

  #alphabet-container {
    grid-template-columns: repeat(10, 70px);
    grid-template-rows: repeat(3, 70px);
    grid-template-areas:
      "alphabet-btnA alphabet-btnB alphabet-btnC alphabet-btnD alphabet-btnE alphabet-btnF alphabet-btnG alphabet-btnH alphabet-btnI alphabet-btnJ"
      "alphabet-btnK alphabet-btnL alphabet-btnM alphabet-btnN alphabet-btnO alphabet-btnP alphabet-btnQ alphabet-btnR alphabet-btnS alphabet-btnT"
      ". . alphabet-btnU alphabet-btnV alphabet-btnW alphabet-btnX alphabet-btnY alphabet-btnZ . .";
  }

  .alphabet-button {
    width: 70px;
    height: 70px;
    font-size: 250%;
  }
}
