:root {
  color-scheme: light;
  font-family: system-ui, sans-serif;
  line-height: 1.4;
  background: #f2f3f5;
  color: #17191d;
}

* { box-sizing: border-box; }
body { margin: 0; }
button, input, select, textarea { font: inherit; }

main {
  width: min(1260px, calc(100% - 48px));
  margin: clamp(28px, 6vw, 72px) auto;
}

h1 {
  margin: 0 0 20px;
  font-size: clamp(1.6rem, 4vw, 2.25rem);
  letter-spacing: -.04em;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 320px);
  gap: 20px;
  align-items: start;
}

canvas {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1659 / 948;
  background: #152036;
}

.editor {
  display: grid;
  gap: 16px;
  padding: 18px;
  border: 1px solid #dadde3;
  border-radius: 8px;
  background: #fff;
}

.field { display: grid; gap: 6px; }
.character-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
label { font-size: .9rem; font-weight: 650; }

input, select, textarea {
  width: 100%;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid #c9cbd2;
  border-radius: 5px;
  background: #fafafb;
  color: inherit;
}

select {
  appearance: none;
  padding-right: 23px;
  background-image: linear-gradient(45deg, transparent 45%, #555963 46% 64%, transparent 65%),
    linear-gradient(-45deg, transparent 45%, #555963 46% 64%, transparent 65%);
  background-position: right 14px center, right 9px center;
  background-size: 5px 6px;
  background-repeat: no-repeat;
}

textarea { resize: vertical; min-height: 89px; }

.actions { display: flex; flex-wrap: wrap; gap: 8px; }

.actions button { font-size: .9rem; }

button {
  min-height: 42px;
  padding: 7px 12px;
  border: 1px solid transparent;
  border-radius: 5px;
  cursor: pointer;
  font-weight: 600;
}

.download { background: #23262e; color: #fff; }
.download:hover { background: #3a3e48; }
.download:disabled { opacity: .65; cursor: default; }
.example { border-color: #d8d9de; background: #fafafb; color: inherit; }
.example:hover { background: #eeeef1; }

:focus-visible { outline: 2px solid #a52066; outline-offset: 2px; }
#status { margin: 0; color: #555963; font-size: .875rem; }
#status:empty { display: none; }

@media (max-width: 750px) {
  main { width: calc(100% - 28px); }
  .workspace { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .editor { padding: 14px; }
}

@media (max-width: 360px) {
  .character-fields { grid-template-columns: minmax(0, 1fr); }
}
