* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background-color: #111;
  color: white;
  font-family: 'Inter', sans-serif;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px;
}

h1 {
  font-size: 36px;
  font-weight: lighter;
  font-family: 'Inter', sans-serif;
  text-align: left;
  margin-top: 10px;
  width: 100%;
  max-width: 1400px;
}

h2 {
  margin: 14px 0;
  text-align: center;
  width: 100%;
  color: #ffbe1a;
}

h3 {
  font-style: italic;
  font-weight: 200;
  text-align: center;
}

/* New main grid for features + canvas */
.feature-canvas-grid {
  display: grid;
  grid-template-columns: 340px 1fr 340px;
  gap: 10px;
  width: 100%;
  margin: 0 auto 32px auto;
  align-items: flex-start;
}

/* Left and right panels */
.button-box,
.button-box2 {
  border-radius: 10px;
  box-shadow: 0 2px 8px #0004;
  padding: 8px;
  min-width: 0;
  width: 100%;
}

/* Center column: canvas */
.canvas-wrapper {
  width: 100%;
  max-width: 1260px;
  margin: 0 auto;
}

.canvas-help {
  margin-top: 14px;
  display: flex;
  justify-content: center;
  flex-direction: column;
}

canvas {
  background-color: black;
  image-rendering: pixelated;
  border: 2px solid #444;
  width: 100%;
  height: auto;
  display: block;
  max-width: 100%;
}

.button-section,
.button-section2 {
  border: 2px solid white;
  padding: 16px;
  margin-top: 14px;
  border-radius: 8px;
  width: 100%;
  box-sizing: border-box;
  background: transparent;
}

legend {
  padding: 0 10px;
  font-size: 24px;
  font-weight: bold;
  color: #ffbe1a;
}

button {
  font-weight: bold;
  padding: 0.75rem;
  margin-top: 0.5rem;
  background-color: #4a4242;
  color: #ffbe1a;
  border: 4px solid white;
  cursor: pointer;
  font-size: 1rem;
  border-radius: 4px;
  width: 100%;
}

button:hover {
  background-color: #ffbe1a;
  color: #4a4242;
}

.send-button {
  background-color: #4E937A;
  color: aliceblue;
}

.send-button:hover {
  background-color: aliceblue;
  color: #4E937A;
}

input[type="file"],
#textInput {
  padding: 10px;
  margin-top: 8px;
  background-color: #444;
  color: white;
  border: 1px solid white;
  cursor: pointer;
  font-size: 16px;
  border-radius: 4px;
  width: 100%;
}

input[type="range"]{
  background-color: #444;
  color: white;
  border: 1px solid white;
  cursor: pointer;
  font-size: 16px;
  border-radius: 4px;
  width: 100%;
}

.input-description {
  font-size: 16px;
  color: #aaa;
  margin-bottom: 4px;
}

.horizontal-buttons {
  display: flex;
  gap: 0.5rem;
}

/* Send-to-board panel: below the main grid/canvas */
.button-box3 {
  margin: 30px auto 0 auto;
  border-radius: 10px;
  box-shadow: 0 2px 8px #0004;
  padding: 16px;
  width: 380px;
  max-width: 90vw;
  display: block;
}

/* Responsive: medium screens */
@media (max-width: 1200px) {
  .feature-canvas-grid {
    grid-template-columns: 1fr 2fr 1fr;
    max-width: 1100px;
    gap: 24px;
  }

  .button-section,
  .button-section2 {
    width: 100%;
  }
}

/* Responsive: tablets/small laptops */
@media (max-width: 900px) {
  .feature-canvas-grid {
    grid-template-columns: 1fr;
    gap: 20px;
    max-width: 100%;
  }

  .button-box,
  .button-box2,
  .button-box3 {
    box-shadow: none;
    background: none;
    border-radius: 0;
    padding: 0;
    width: 100%;
    margin: 0;
  }

  .button-section,
  .button-section2 {
    width: 95%;
    margin: 0 auto 16px auto;
  }

  .button-box3 {
    margin-top: 16px;
    width: 95%;
  }
}

/* Responsive: phones */
@media (max-width: 768px) {
  h1 {
    font-size: 28px;
    text-align: center;
  }

  .canvas-wrapper {
    max-width: 100%;
  }

  canvas {
    width: 100%;
    max-width: 100%;
  }

  .feature-canvas-grid {
    grid-template-columns: 1fr;
    gap: 18px;
    max-width: 100%;
  }

  button,
  input[type="file"],
  input[type="range"],
  #textInput {
    font-size: 14px;
    padding: 8px;
    width: 100%;
  }

  legend {
    font-size: 20px;
  }
}
