@import url("https://fonts.googleapis.com/css2?family=Fleur+De+Leah&family=Indie+Flower&family=Krona+One&family=Montserrat:ital,wght@0,100..900;1,100..900&family=Permanent+Marker&family=Roboto:ital,wdth,wght@0,75..100,100..900;1,75..100,100..900&display=swap");

/*---------------------------------------------*/
body {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-color: rgb(41, 41, 47);
  margin: 0;
  padding: 30px 0px 30px 0px;
  /*overflow: hidden;*/
}
/*---------------------------------------------*/

/*#region cxInicio-----------------------------*/

.cxInicio {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

/*#region contTitulo-----------------------------*/

.contTitulo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.titulo {
  display: flex;
  font-family: "Indie Flower";
  font-size: 40px;
  font-weight: 400;
  color: #e5dff9;
}

/*#region controls-----------------------------*/

.controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

#resetBtn {
  padding: 8px 16px;
  background-color: #5b5188;
  color: rgb(220, 217, 217);
  border: none;
  border-radius: 5px;
  font-size: 15px;
  cursor: pointer;
}

#resetBtn:hover {
  background-color: #9a89e3;
}

#resetBtn:active {
    transform: scale(0.95); /* ← efeito de pressionar */
    background-color: #7b5ff9; /* ← cor diferente ao pressionar */
}

.preset-slider {
  display: flex;
  align-items: center;
  color: white;
}

#gridPreset {
  width: 80px;
}

/*#endregion -----------------------------*/

/*#endregion -----------------------------*/

/*#region color-controls-----------------------------*/

.color-controls {
  transform: scale(0.8, 0.8);
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  color: white;
}

/*#region caixa-colorPicker-----------------------------*/

.caixa-colorPicker {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 10px;
}

#colorPicker {
  width: 60px;
  height: 50px;
  border: 2px solid #747474;
  background-color: #5b5188;
  border-radius: 5px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
}

#eraserBtn {
  order: -1;
  padding: 6px 8px;
  background-color: #5b5188;
  color: #dadae2;
  border: 2px solid transparent;
  border-radius: 5px;
  cursor: pointer;
  font-size: 10px;
  font-weight: 600;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: all 0.5s;

  min-width: 60px; /* ← largura mínima fixa */
  max-width: 80px; /* ← largura máxima fixa */
  overflow: hidden;
}

#eraserBtn i {
  font-size: 25px;
}

#eraserBtn.active {
  background-color: #ac454596;
  border: 2px solid #7b5ff9;
  transform: scale(1.05);
}

.eraser-cursor {
  position: fixed;
  border: 2px solid #8f8f8f;
  background-color: rgba(255, 0, 0, 0.1); /* ← fundo sutil */
  border-radius: 50%;
  pointer-events: none;
  z-index: 1000;
  display: none;
}

/*#endregion-----------------------------*/

/*#region recent-colors-----------------------------*/

.recent-colors {
  transform: scale(0.8);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  background-color: #5b5188;
  border-radius: 5px;
  border: solid 1px #858589;
  padding: 5px 5px 10px 5px;
  width: 60%;
}

.recent-colors span {
  color: #cdc4c4;
  font-weight: 800;
  text-align: center;
}

.color-history-container {
  display: flex;
  flex-direction: row;
  gap: 4px;
  flex-wrap: wrap;
  justify-content: center;
}

.color-history-item {
  width: 35px;
  height: 35px;
  border: 2px solid #b0a7d7;
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.2s;
}

.color-history-item:hover {
  transform: scale(1.2);
}

/*#endregion-----------------------------*/

/*#endregion-----------------------------*/

/*#endregion---------------------------------*/

/*#region Grid--------------------------------------*/

.tela {
  display: flex;
  justify-content: center;
  align-items: center;
}

#container {
  display: flex;
  flex-wrap: wrap;
  width: 90vw;
  height: 75vh;
  max-width: 700px;
  max-height: 500px;
  touch-action: none;
}

.cell {
  background-color: transparent;
  box-sizing: border-box;
  border: 1px solid #5a5a5a6a;
  user-select: none;
}

/*#endregion-----------------------------------------*/

/*#region SÓ MOBILE */
@media (hover: none) and (pointer: coarse) {
  .cell {
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
  }
}
/*#endregion  */

/*#region Mobile Vertical---------------------------*/
@media (max-width: 768px) {
  .cxInicio {
    gap: 2px;
  }

  .contTitulo {
    padding: 0px 0px 0px 0px;
  }

  .titulo {
    transform: scale(1, 1.5);
    align-items: center;
    justify-content: center;
    text-align: center;
  }
  /*------------------------------------------------*/

  .controls {
    transform: scale(1, 0.9);
    flex-direction: column; /* botão embaixo do input */
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
  }

  #gridPreset {
    width: 55px;
  }

  /*------------------------------------------------*/

  .caixa-colorPicker {
    padding: 0px 15px;
  }

  #colorPicker {
    width: 60px;
    height: 50px;
  }

  /*------------------------------------------------*/

  .eraser-cursor {
    position: touch;
    border: 2px solid #c7bbbb;
    border-radius: 50%;
    pointer-events: none;
    z-index: 1000;
    display: none;
  }

  /*------------------------------------------------*/

  .recent-colors {
    flex-wrap: wrap; /* quebra linha se necessário */
    padding: 5px 0px;
    width: 200px;
  }

  .color-history-item {
    width: 24px;
    height: 24px;
  }

  /*------------------------------------------------*/

  #container {
    width: 82vw;
    height: 70vh;
    max-width: 700px;
    max-height: 600px;
    justify-content: center;
    align-items: center;
    padding-top: 5px;
  }
}

/*#endregion------------------------------------------------*/

@media (min-width: 769px) {
  .cxInicio {
    justify-content: center;
    flex-wrap: nowrap;
    width: 90vw; /* ← MESMA largura do grid */
    max-width: 700px; /* ← MESMO max-width do grid */
    margin: 0 auto;
    padding: 5px 0;
  }

  .contTitulo {
    transform: scale(0.9);
    flex: 0 1 auto;
  }

  .color-controls {
    transform: scale(0.9);
    flex: 0 1 auto;
  }

  .color-history-container {
    flex-wrap: nowrap;
  }
}
