/* Base styles */
body {
  background-color: #000;
  color: #fff;
  font-family: 'Trebuchet MS', 'Lucida Sans Unicode', 'Lucida Grande', 'Lucida Sans', Arial, sans-serif;
  text-align: center;
  margin: 0;
  padding: 1rem;
}

#box{
  margin: 4% auto;
  background-color: #212529;
  max-width: 720px;
  border: 6px solid #212529;
  border-radius: 8px;
  padding: 1rem;
  box-sizing: border-box;
}
/* Ensure consistent box sizing */
* { box-sizing: border-box; }

/* Palette grid (uses divs .palette and .cell) */
.palette {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(56px, 1fr));
  gap: 8px;
  justify-content: center;
  padding: 0.25rem;
  width: auto;
  margin: 0 auto;
}

.cell {
  background-color: #000;
  color: #fff;
  border: 2px solid #2e2e2e;
  padding: 6px;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1 / 1;
  font-weight: 600;
  font-size: 12px;
  min-width: 48px;
}

button {
  border: none;
  color: white;
  padding: 14px 20px;
  text-align: center;
  text-decoration: none;
  display: block;
  border-radius: 6px;
  font-size: 16px;
  margin: 12px auto 4px;
  cursor: pointer;
  background-color: #008CBA;
  max-width: 320px;
  width: calc(100% - 2rem);
}

button:hover{ background-color: #005a79; }
button:active{ background-color: #003749; }

@media (min-width: 720px) {
  .palette {
    grid-template-columns: repeat(5, 64px);
    gap: 8px;
  }

  .cell {
    padding: 4px;
    font-size: 11px;
  }

  button {
    max-width: 260px;
    padding: 10px 14px;
  }
}

@media (max-width: 420px) {
  .palette {
    grid-template-columns: repeat(auto-fit, minmax(56px, 1fr));
    gap: 6px;
  }
  .cell {
    font-size: 11px;
    padding: 4px;
  }
  #box { padding: 0.5rem; }
  button { width: 100%; max-width: none; }
}