/* === ESTILO GERAL === */
body {
  margin: 0;
  padding: 0;
  font-family: 'Comic Sans MS', cursive, sans-serif;
  background: linear-gradient(to bottom, #d0f0ff, #a0e3f0);
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
}

header {
  text-align: center;
  color: #045;
  margin-top: 1rem;
  padding: 0 1rem;
}

h1 {
  font-size: 2.2rem;
  margin-bottom: 0.3rem;
}

.sub {
  font-size: 1rem;
  color: #066;
}

#background-particles {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.particle {
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}

main {
  z-index: 1;
  width: 100%;
  max-width: 600px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

#board {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  margin: 1rem auto;
  background: #ffffffcc;
  padding: 10px;
  border-radius: 12px;
  box-shadow: 0 0 20px rgba(0,0,0,0.1);
  position: relative;
}

.cell {
  width: 50px;
  height: 50px;
  font-size: 1.8rem;
  background: #fff;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  position: relative;
  overflow: hidden;
}

.cell:hover {
  transform: scale(1.1);
  box-shadow: 0 0 10px #88ccff;
}

.cell.selected {
  background: #b3e5fc;
  box-shadow: 0 0 12px #039be5;
}

.cell.destaque {
  background-color: #ffeb3b;
  animation: pulse 1.5s ease infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.2); }
}

.wave-effect {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 191, 255, 0.5);
  background: linear-gradient(90deg, rgba(173,216,230,0.4) 0%, rgba(0,191,255,0.9) 50%, rgba(173,216,230,0.4) 100%);
  animation: waveSweep 0.8s ease-out forwards;
  z-index: 2;
  pointer-events: none;
  border-radius: 10px;
}

@keyframes waveSweep {
  0% { transform: translateX(-100%); opacity: 1; }
  100% { transform: translateX(100%); opacity: 0; }
}

#hud {
  display: flex;
  justify-content: center;
  width: 100%;
  gap: 1rem;
  margin-bottom: 1rem;
  padding: 0 1rem;
  flex-wrap: wrap;
}

#hud span {
  background: #0288d1;
  color: #fff;
  padding: 0.8rem 1.2rem;
  border-radius: 14px;
  font-weight: bold;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  min-width: 140px;
  text-align: center;
  font-size: 1.1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

#powerups {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 1rem;
  padding: 0 1rem;
}

#powerups button {
  padding: 0.6rem 1rem;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, #81d4fa, #4fc3f7);
  color: #fff;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
  transition: background 0.3s, transform 0.2s;
}

#powerups button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

#powerups button:hover:not(:disabled) {
  background: linear-gradient(135deg, #4fc3f7, #29b6f6);
  transform: scale(1.05);
}

#message {
  margin-bottom: 0.5rem;
  font-weight: bold;
  color: #045;
}

.toast-message {
  position: fixed;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  background: #03a9f4;
  color: white;
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  z-index: 99;
  font-weight: bold;
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
  animation: fade 0.3s ease;
}

@keyframes fade {
  from { opacity: 0; transform: translateX(-50%) translateY(-10px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.btn-voltar {
  background: #0288d1;
  color: white;
  padding: 0.6rem 1.2rem;
  border-radius: 10px;
  text-decoration: none;
  font-weight: bold;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  margin: 1rem auto;
  display: inline-block;
  transition: background 0.3s;
}

.btn-voltar:hover {
  background: #0277bd;
}

@media (max-width: 480px) {
  #board {
    grid-template-columns: repeat(6, 40px);
    gap: 6px;
    padding: 8px;
  }

  .cell {
    width: 40px;
    height: 40px;
    font-size: 1.5rem;
  }

  #hud span {
    font-size: 0.95rem;
    padding: 0.6rem 0.8rem;
  }

  #powerups button {
    font-size: 0.85rem;
    padding: 0.4rem 0.6rem;
  }
}
