@import url('https://fonts.googleapis.com/css2?family=Nunito:ital,wght@0,200..1000;1,200..1000&display=swap');
@import url('./media.css');

@font-face {
  font-family: 'FontePrincipal';
  src: url('./assets/Excalifont.ttf') format('truetype');
}
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  background: #fcf9da;
  font-family: 'FontePrincipal', sans-serif;
  display: grid;
  grid-template-rows: auto 1fr auto;
  color: #460404;
}
p,
.btn-clear,
.btn-clearDraw,
.btn-clearScreen {
  font-family: 'Nunito', sans-serif;
}

header {
  text-align: center;
  padding: 1rem;
  font-size: 1.4rem;
  color: #065006;
}
.header-title {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.6rem;
}
.header-title h1 {
  font-size: 1.6rem;
}
.header-title img {
  width: 36px;
}

.main-layout {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
}

.canvas-wrapper {
  width: 100%;
  max-width: 820px;
  display: flex;
  justify-content: center;
  align-items: center;
}

canvas {
  width: 100%;
  max-width: 700px;
  height: auto;
  aspect-ratio: 7 / 6; /* apenas aspecto visual; pixels reais da tela tratados em JS */
  border: 2px solid #b6b07b;
  background: #fff;
  border-radius: 10px;
  cursor: crosshair;
  touch-action: none; /* mobile não rola a tela ao desenhar */
}

.tools {
  width: 100%;
  padding: 1rem;
  border-radius: 10px;
  border: 2px solid #9b3636;
  background-color: #fcd6d6;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  color: #460404;
}

.side-left,
.side-right {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.coresArea h2,
.espessuras h2,
.buttons-clear h2,
.containerLetras h2,
.containerNumeros h2 {
  margin-bottom: 0.4rem;
}

.coresArea-cores {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}
.color {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid rgba(0, 0, 0, 0.05);
}
.coresArea .active {
  border: 4px solid white;
}
.cor0 {
  background-color: #000000;
}
.cor1 {
  background-color: #ff99bb;
}
.cor2 {
  background-color: #0000ff;
}
.cor3 {
  background-color: #aa00ff;
}
.cor4 {
  background-color: #ff5500;
}
.cor5 {
  background-color: #008000;
}
.cor6 {
  background-color: #773300;
}
.cor7 {
  background-color: #00bbff;
}
.cor8 {
  background-color: #ff0000;
}
.cor9 {
  background-color: #ffff00;
}
.cor10 {
  background-color: #555555;
}
.cor11 {
  background-color: #00ffff;
}
.cor12 {
  background-color: #00ff00;
}
.cor13 {
  background-color: #ff0077;
}
.cor14 {
  background-color: #800088;
}

/* espessuras */
.espessurasContainer {
  display: flex;
  gap: 0.4rem;
}
.espessurasButton {
  background: transparent;
  border: none;
  border-radius: 50%;
  padding: 0.1rem;
}
.espessurasButton i {
  color: #330055;
  cursor: pointer;
  transition: transform 0.2s, border-color 0.2s;
  font-size: 1.4rem;
}
.espessurasContainer .active {
  background-color: #ff6961;
}
.padrao i {
  font-size: 1.4rem;
}
.fino i {
  font-size: 1.7rem;
}
.medio i {
  font-size: 2rem;
}
.grosso i {
  font-size: 2.4rem;
}

/* buttons */
.btn,
.btn-maiuscula,
.btn-numero,
.btn-minuscula {
  color: #fff;
  padding: 0.5rem 0.8rem;
  font-size: 1rem;
  cursor: pointer;
  font-weight: bold;
  border: none;
  border-radius: 30px;
  transition: 0.15s;
  font-family: 'FontePrincipal', sans-serif;
}
.btn-clearDraw {
  font-size: 1rem;
  background-color: #1c7fff;
}
.btn-clearScreen {
  background-color: #049ca1;
}
.btn-maiuscula {
  background-color: #a200ff;
}
.btn-minuscula {
  background-color: #06be0f;
}
.btn-numero {
  background-color: #00a2ff;
}

button:hover {
  filter: brightness(0.95);
  transform: translateY(-2px);
  background: #ff6961;
}

#msgFlutuante {
  position: fixed;
  bottom: 4.5rem;
  left: 50%;
  transform: translateX(-50%);
  background: #ff6961;
  color: white;
  padding: 10px 16px;
  border-radius: 30px;
  font-size: 0.95rem;
  font-weight: bold;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 99;
}
#msgFlutuante.show {
  opacity: 1;
  transform: translateX(-50%) translateY(-6px);
}
.hidden {
  display: none;
}

footer {
  text-align: center;
  background-color: #b6b07b;
  padding: 0.7rem;
  margin-top: 0.4rem;
}

/*  TABLET  */
@media (min-width: 640px) {
  header {
    padding: 1.2rem;
  }
  .header-title h1 {
    font-size: 2rem;
  }
  .main-layout {
    gap: 1.5rem;
    padding: 1.5rem;
  }

  .tools {
    flex-direction: row;
    gap: 1.5rem;
    align-items: flex-start;
    padding: 1.5rem;
  }
  .side-left,
  .side-right {
    flex: 1;
    gap: 1rem;
  }
  .canvas-wrapper {
    max-width: 700px;
  }
}

/* TABLET / DESKTOP  */
@media (min-width: 900px) {
  body {
    font-size: 16px;
  }
  header {
    padding: 1.5rem;
  }
  .main-layout {
    flex-direction: row;
    align-items: flex-start;
    justify-content: center;
    gap: 2rem;
    padding: 2rem;
  }
  .canvas-wrapper {
    flex: 0 0 720px;
  }
  .tools {
    width: 750px;
    padding: 2rem;
    gap: 2rem;
  }
  .header-title h1 {
    font-size: 2.6rem;
  }
}

.btn-click {
  margin: 0.15rem;
}
