* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background: #1c1d22;
  color: #eee;
  font-family: system-ui, sans-serif;
  display: flex;
  justify-content: center;
  padding: 40px 20px;
}

.app {
  width: 100%;
  max-width: 760px;
}

h1 {
  margin: 0;
  font-size: 26px;
}

.subtitle {
  color: #999;
  margin: 5px 0 25px;
}

.controls {
  background: #282a31;
  border-radius: 10px;
  padding: 20px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.control {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.wide {
  grid-column: 1 / -1;
}

label {
  color: #ccc;
  font-size: 13px;
  font-weight: 600;
}

select {
  appearance: auto;
  background: #17181c;
  color: #eee;
  border: 1px solid #444750;
  border-radius: 6px;
  padding: 9px 10px;
  font: inherit;
}

#customColorControl {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

#customColor {
  width: 100%;
  height: 40px;
  padding: 2px;
  border: 1px solid #ccc;
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
}

.severity-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.severity-row input {
  flex: 1;
}

input[type="range"] {
  accent-color: #6887ff;
}

#severityValue {
  width: 25px;
  text-align: center;
  font-weight: bold;
  font-size: 18px;
}

.preview {
  margin-top: 20px;
  min-height: 330px;
  border-radius: 10px;

  background-color: #34363d;
  background-image:
    linear-gradient(45deg, #2d2f35 25%, transparent 25%),
    linear-gradient(-45deg, #2d2f35 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #2d2f35 75%),
    linear-gradient(-45deg, transparent 75%, #2d2f35 75%);
  background-size: 24px 24px;
  background-position:
    0 0,
    0 12px,
    12px -12px,
    -12px 0;

  display: flex;
  align-items: center;
  justify-content: center;
}

canvas {
  display: block;
  image-rendering: auto;
  box-shadow: 0 10px 35px rgba(0, 0, 0, 0.5);
}

.info {
  display: flex;
  justify-content: space-between;
  color: #888;
  font-size: 12px;
  margin-top: 10px;
}

.buttons {
  margin-top: 15px;
}

button {
  width: 100%;
  padding: 11px;
  border: 0;
  border-radius: 6px;
  background: #5b78ed;
  color: white;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

button:hover {
  background: #6b87fa;
}

@media (max-width: 600px) {
  .controls {
    grid-template-columns: 1fr;
  }

  .wide {
    grid-column: auto;
  }
}
