@import url("https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,600;1,9..40,400&display=swap");

:root {
  --bg: #0f1419;
  --surface: #1a222c;
  --text: #e8ecf0;
  --muted: #8b98a6;
  --accent: #3d9cf0;
  --error: #f06666;
  --font: "DM Sans", system-ui, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  background: radial-gradient(ellipse 120% 80% at 50% -20%, #1e3a5f 0%, var(--bg) 55%);
  color: var(--text);
  line-height: 1.5;
}

.wrap {
  max-width: 36rem;
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
}

h1 {
  font-size: 1.75rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0 0 0.5rem;
}

.lead {
  color: var(--muted);
  margin: 0 0 1.25rem;
  font-size: 0.95rem;
}

.fields {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(7.5rem, 1fr));
  gap: 0.75rem 1rem;
  align-items: end;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}

.field label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
}

.field--action {
  grid-column: 1 / -1;
}

@media (min-width: 520px) {
  .field--action {
    grid-column: auto;
    align-self: end;
  }
}

.field-label-spacer {
  display: block;
  font-size: 0.8rem;
  line-height: 1.2;
  visibility: hidden;
}

input[type="number"] {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border: 1px solid #2d3845;
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
}

input[type="number"]:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-color: transparent;
}

.field--action button {
  width: 100%;
}

@media (min-width: 520px) {
  .field--action button {
    width: auto;
    min-width: 7.5rem;
  }
}

button {
  padding: 0.65rem 1.1rem;
  border: none;
  border-radius: 8px;
  background: var(--accent);
  color: #061018;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

button:hover {
  filter: brightness(1.08);
}

button:active {
  transform: scale(0.98);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.error {
  color: var(--error);
  font-size: 0.9rem;
  margin: 0.75rem 0 0;
}

.canvas-box {
  margin-top: 1.5rem;
  padding: 1rem;
  background: var(--surface);
  border-radius: 12px;
  border: 1px solid #2d3845;
  display: flex;
  justify-content: center;
}

canvas {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  background: #0d1117;
}

.specs {
  margin: 1.25rem 0 0;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.35rem 1rem;
  font-size: 0.9rem;
}

.specs dt {
  color: var(--muted);
  margin: 0;
}

.specs dd {
  margin: 0;
  font-variant-numeric: tabular-nums;
}
