/* Reset básico */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
  background: linear-gradient(135deg, #ff4c00, #ffa040);
  color: white;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  padding: 12px 12px 40px;
  user-select: none;
}

h1 {
  margin-bottom: 12px;
  text-shadow: 0 0 6px #330000;
  font-size: 1.8rem;
  text-align: center;
}

.botoes {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 8px;
  width: 100%;
  max-width: 480px;
}

.botoes button {
  background: #ff6f1f;
  border: none;
  padding: 12px 24px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 1rem;
  color: white;
  cursor: pointer;
  box-shadow: 0 0 8px #ff4c00cc;
  transition: background-color 0.3s ease;
}

.botoes button:hover,
.botoes button:focus {
  background: #ff9350;
  outline: none;
}

#axé-count {
  font-size: 1.1rem;
  margin-bottom: 6px;
  text-align: center;
  text-shadow: 0 0 6px #330000;
}

#mensagem {
  min-height: 1.8em;
  font-size: 1.2rem;
  margin-bottom: 12px;
  text-align: center;
  font-weight: 600;
  text-shadow: 0 0 10px #440000;
}

#labirinto {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  grid-template-rows: repeat(10, 1fr);
  gap: 4px;
  width: 100vw;
  max-width: 360px;
  aspect-ratio: 1 / 1;
  touch-action: manipulation;
}

.celula {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 10px;
  transition: background-color 0.3s ease;
  box-shadow:
    inset 0 0 6px #220000aa;
}

.celula.parede {
  background: #440000;
}

.celula.axé {
  background: gold;
  box-shadow:
    0 0 8px 2px gold,
    inset 0 0 15px 4px #ffd700aa;
}

.celula.encruzilhada {
  background: limegreen;
  box-shadow:
    0 0 12px 3px limegreen,
    inset 0 0 10px 4px #32cd3299;
}

.celula.exu {
  background: #ff4c00;
  box-shadow:
    0 0 12px 3px #ff4c00,
    inset 0 0 15px 6px #ff4c00cc;
  position: relative;
}

.celula.exu::after {
  content: '⚡';
  font-size: 1.8rem;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -55%);
  pointer-events: none;
}

/* Hover para desktop */
@media(min-width: 600px) {
  body {
    padding: 24px 48px;
  }

  h1 {
    font-size: 2.8rem;
  }

  #labirinto {
    max-width: 500px;
    grid-template-columns: repeat(10, 50px);
    grid-template-rows: repeat(10, 50px);
    gap: 6px;
  }

  .celula {
    border-radius: 12px;
    box-shadow:
      inset 0 0 10px #ff4c0044,
      0 3px 8px #330000bb;
  }

  .celula.parede:hover {
    background: #660000;
    cursor: not-allowed;
  }

  .botoes {
    justify-content: flex-start;
    gap: 20px;
    max-width: 520px;
  }

  .botoes button {
    flex: 0 0 160px;
    font-size: 1.3rem;
  }

  #mensagem {
    font-size: 1.4rem;
    min-height: 2em;
  }

  #axé-count {
    font-size: 1.5rem;
  }
}

/* Botão voltar fixo no topo para desktop */
@media(min-width: 600px) {
  #voltarBtn {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 20;
    background: #ff4c00ee;
    padding: 12px 20px;
    font-weight: 900;
    font-size: 1.1rem;
    border-radius: 12px;
    box-shadow: 0 0 18px #ff4c00cc;
    cursor: pointer;
    transition: background-color 0.3s ease;
  }
  #voltarBtn:hover {
    background: #ff6f1f;
  }
}

/* Canvas partículas fica full screen atrás */
#particulas {
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  width: 100vw;
  height: 100vh;
  z-index: 0;
}
