/* GLOBAL */

:root {
  --cinza: #aaa;
  --verde: #006000;
  --amarelo: rgb(255, 238, 0);
  --azul: #252dbb;
}

@font-face {
  font-family: SMW2;
  src: url(../font/SMW2-Yoshis-Island.ttf);
}

body {
  width: 100%;
  min-height: 100vh;
  align-items: center;
  display: flex;
  flex-direction: column;
}

/* MENU */

.menu {
  font-family: SMW2;
  color: var(--cinza);
  justify-content: center;
  background: url(../assets/menu-background-img.png) center no-repeat, #000000;
  background-size: cover;
}

.menu__intro {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: calc(37vh - 96px) 0 auto;
}

.menu__intro__titulo {
  margin-bottom: 1%;
  font-size: clamp(4rem, 1.137rem + 12.214vw, 7rem);
  color: var(--amarelo);
  text-align: center;
}

.menu__intro__comecar__1p,
.menu__intro__comecar__2p {
  font-size: clamp(2.5rem, 0.714rem + 8.929vw, 5rem);
}

/* SELEÇÃO DE PERSONAGEM */

.personagem {
  justify-content: center;
  font-family: SMW2;
  background: url(../assets/personagem-background-img.png) center no-repeat,
    #000098;
  height: fit-content;
  min-height: 100vh;
  width: 100%;
  background-size: cover;
}

.personagem__main {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 55rem;
  margin: 0 10px;
}

.personagem__titulo {
  margin-bottom: 20px;
  font-size: clamp(3rem, 2.143rem + 4.286vw, 6rem);
  text-align: center;
  color: var(--amarelo);
}

.personagens {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  background: var(--cinza);
  box-shadow: 6px 8px 0 6px #666, 10px 10px 10px #000;
  border-radius: 30px;
  gap: 25px;
  padding: 5%;
}

.yoshi {
  background-color: #90a860;
  box-shadow: 5px 5px 0 #307878;
  cursor: pointer;
  height: 120px;
  width: 120px;
}

.yoshi span {
  position: absolute;
  font-size: 24px;
  margin-left: -110px;
}

.start {
  color: var(--amarelo);
  margin-top: 5px;
  font-size: 3rem;
}

/* PARTIDA */

.partida {
  font-family: SMW2;
  background: url(../assets/game-background-img.png) bottom no-repeat, #00a8f3;
  min-height: 100vh;
  width: 100%;
  background-size: cover;
}

.partida__main {
  margin-top: 2%;
}

.partida__titulo {
  margin-bottom: 20px;
  font-size: clamp(4rem, 1.857rem + 10.714vw, 7rem);
  text-align: center;
  color: var(--amarelo);
}

.campo {
  display: flex;
  flex-direction: row;
  align-items: center;
  width: 100%;
}

.P1 {
  height: 33.3%;
  width: 10rem;
  z-index: 1;
}

.P2 {
  height: 33.3%;
  width: 10rem;
  -moz-transform: scaleX(-1);
  -o-transform: scaleX(-1);
  -webkit-transform: scaleX(-1);
  transform: scaleX(-1);
  z-index: 1;
}

#game {
  margin: 20px auto;
  width: 400px;
  text-align: center;
}

#status {
  font-size: 40px;
}

#board {
  display: flex;
  flex-wrap: wrap;
  width: 300px;
  height: 300px;
  margin: 0 auto;
  border: 4px solid #489078;
}

.square {
  width: 33.3%;
  height: 33.3%;
  align-items: center;
  background-color: white;
  border: 1px solid black;
  font-size: 60px;
  text-align: center;
  line-height: 100px;
  cursor: pointer;
  position: relative;
}

.square img {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 70%;
  transform:translate(-50%, -50%);
}

.square p {
  position: absolute;
  right: 0;
  top: -40%;
  font-size: 2rem;
}

#reset {
  margin-top: 20px;
  padding: 10px;
  font-size: 20px;
  cursor: pointer;
  font-size: 40px;
  background-color: hsl(199, 100%, 48%, 80%);
}

/* RODAPÉ */

.rodape {
  font-family: SMW2;
  font-size: clamp(1.5rem, 1.143rem + 1.786vw, 2rem);
  text-align: center;
}

.menu .rodape {
  margin: auto 0 17vh;
}

.personagem__rodape {
  margin-top: 20px;
  color: var(--amarelo);
  bottom: 0;
}

.partida__rodape {
  font-size: 150%;
  color: #000;
  background-color: hsla(120, 100%, 19%, 80%);
  padding: 10px;
  margin: auto 0 0;
}

/* HOVER & FOCUS */

.menu__intro__comecar__1p:hover,
.menu__intro__comecar__1p:focus,
.menu__intro__comecar__2p:hover,
.menu__intro__comecar__2p:focus,
.voltar-menu:hover,
.voltar-menu:focus,
.start:hover,
.start:focus {
  color: var(--verde);
}

.partida .voltar-menu:hover,
.partida .voltar-menu:focus,
#reset:hover,
#reset:focus {
  color: var(--azul);
}

.yoshi:hover :not(.selected),
.yoshi:focus :not(.selected) {
  background-color: #86a83b;
  box-shadow: 5px 5px 0 #235757;
  border: 1px solid #e4e4a2;
}

.yoshi:focus .selected,
.yoshi:focus :not(.selected) {
  outline: thick double #235757;
}

.yoshi:hover .selected + span,
.yoshi:focus .selected + span {
  background: none;
  box-shadow: none;
  border: none;
  outline: none;
}

.yoshi.ativa,
.yoshi:active,
.selected {
  background-color: #d8a860;
  border: 4px solid #dbdb84;
  box-shadow: 3px 3px 0 #666 inset;
}

.voltar-menu.ativa,
.voltar-menu:active,
.menu__intro__comecar.ativa,
.menu__intro__comecar:active,
.start.ativa,
.start:active,
#reset:active {
  color: var(--azul);
}

.yoshi.focus,
.yoshi:focus {
  outline: none;
  box-shadow: 10px 10px 10px var(--verde);
}

.yoshi.ativa:focus,
.yoshi:active:focus {
  box-shadow: 3px 3px 0 var(--verde) inset, 10px 10px 10px var(--verde);
}

.square:hover, .square:focus {
  background-color: var(--verde);
}

/* RESPONSIVE */

@media (max-width: 740px) {
  .personagem__titulo {
    line-height: 2.5rem;
    margin-bottom: 10px;
  }
  
  .yoshi {
    width: 5rem;
    height: 5rem;
  }

  .partida__titulo {
    margin-bottom: 0;
  }
  
  .campo {
    position: relative;
  }

  #game {
    width: 320px;
  }

  .P1 {
    position: absolute;
    left: 0;
    bottom: -40px;
    width: 5rem;
  }
  
  .P2 {
    position: absolute;
    right: 0;
    bottom: -40px;
    width: 5rem;
  }
}
