h1 {
  margin: 40px auto 30px; 
  font-weight: 700;
  font-size: 22px;
  color: #fff;
  text-align: center;
}

#dropZone {
  width: 90vw;
  max-width: 600px;
  padding: 30px;
  border: 3px dashed #2196f3;
  border-radius: 12px;
  background: #fff;
  text-align: center;
  color: #222;
  font-size: 1.2rem;
  margin-bottom: 20px;
  cursor: pointer;
  user-select: none;
}

#dropZone.hover {
  background-color: #0d47a1;
  color: #fff;
}

#canvasWrapper {
  width: 90vw;
  max-width: 600px;
}

canvas {
  width: 100%;
  height: auto;
  border-radius: 12px;
  border: 2px solid #d0d7de;
  background: #fff;
  cursor: crosshair;
  touch-action: none;
  display: block;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin: 15px 0 25px;
  max-width: 600px;
}

.control-group {
  display: flex;
  flex-direction: column;
  min-width: 120px;
  flex: 1 1 120px;
}

label {
  font-weight: 600;
  margin-bottom: 4px;
  font-size: .9rem;
}

select, input[type='range'], input[type='text'] {
  border-radius: 8px;
  border: none;
  padding: 8px 10px;
  font-size: 1rem;
}

input[type='text'] {
  background: #222;
  color: #eee;
  border: 1px solid #444;
  font-family: monospace;
}

button {
  background: #2196f3;
  border: none;
  color: white;
  font-size: 1rem;
  padding: 12px 18px;
  border-radius: 12px;
  cursor: pointer;
  flex: 1 1 140px;
  transition: background-color .2s ease;
  user-select: none;
}

button:hover:not(:disabled) {
  background-color: #1769aa;
}

button:disabled {
  background-color: #262e39;
  cursor: default;
}

#status {
  min-height: 24px;
  font-weight: 600;
  margin-bottom: 10px;
  padding-top: 15px;
  font-size: 1rem;
  text-align: center;
  color: #4caf50;
  user-select: none;
}

@media (max-width: 480px) {
  .controls {
    flex-direction: column;
    max-width: 100%;
  }

  button {
    flex: 1 1 100%;
  }
}

.main-container {
  background: #394555;
  margin: 0 auto;
  padding: 2rem 1rem;
  max-width: 800px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0,0,0,.05);
}

/* Mobile fix */

/* Mobile stacking improvements */
@media (max-width: 600px) {
  #dropZone, canvas, #status, .controls, button, .control-group {
    width: 100% !important;
    max-width: 100% !important;
  }

  body {
    padding: 10px;
  }

  h1 {
    font-size: 1.6rem;
    text-align: center;
    margin-bottom: 16px;
  }

  .controls {
    flex-direction: column;
    gap: 14px;
    align-items: stretch;
    margin-top: 10px;
  }

  .control-group {
    flex: 1 1 auto;
    min-width: 100%;
  }

  input[type='range'] {
    width: 100%;
  }

  button {
    width: 100%;
    padding: 14px;
    font-size: 1rem;
  }

  #status {
    text-align: center;
    font-size: 1rem;
    margin-bottom: 12px;
  }
}

p {
  font-size: 20px;
  text-align: center;
}
