text: const FRONT = "c-card_front";
  const BACK = "c-card_back";
  const CARD = "card";
  const ICON = "icon";
  
  startGame();
  
  function startGame() {
     initializeCards(game.createCardsFromTechs());
  }
  
  function initializeCards() {
     let gameBoard = document.getElementById("js-gameBoard");
     gameBoard.innerHTML = "";
     game.cards.forEach((card) => {
        let cardElement = document.createElement("div");
        cardElement.id = card.id;
        cardElement.classList.add(CARD);
        cardElement.dataset.icon = card.icon;
  
        createCardContent(card, cardElement);
        cardElement.addEventListener("click", flipCard);
        gameBoard.appendChild(cardElement);
     });
  }
  
  function createCardContent(card, cardElement) {
     createCardFace(FRONT, card, cardElement);
     createCardFace(BACK, card, cardElement);
  }
  
  function createCardFace(face, card, element) {
     let cardElementFace = document.createElement("div");
     cardElementFace.classList.add(face);
  
     if (face === FRONT) {
        let iconElement = document.createElement("img");
        iconElement.classList.add(ICON);
        iconElement.src = "./assets/" + card.icon + ".png";
        cardElementFace.appendChild(iconElement);
     } else {
        cardElementFace.innerHTML = "&lt/&gt";
     }
     element.appendChild(cardElementFace);
  }
  
  // createCardsFromTechs(techs);
  
  function flipCard() {
     if (game.setCard(this.id)) {
        this.classList.add("c-flip");
        if (game.secondCard) {
           if (game.checkMatch()) {
              game.clearCards();
              if (game.checkGameOver()) {
                 let gameoverLayer = document.getElementById("js-gameover");
                 gameoverLayer.style.display = "flex";
              }
           } else {
              setTimeout(() => {
                 let firstCardView = document.getElementById(game.firstCard.id);
                 let secondCardView = document.getElementById(game.secondCard.id);
  
                 firstCardView.classList.remove("c-flip");
                 secondCardView.classList.remove("c-flip");
                 game.unflipCard();
              }, 1000);
           }
        }
     }
  }
  
  function restart() {
     game.clearCards();
     startGame();
     let gameoverLayer = document.getElementById("js-gameover");
     gameoverLayer.style.display = "none";
  }
  