:root {
  color-scheme: dark;
  --bg: #0b0b0d;
  --fg: #e8e6e1;
  --dim: #8a8780;
  --line: #2a2a2e;
  --vowel: #f2c94c;
  --soft: #6fcf97;
  --sharp: #eb5757;
  --hard: #56ccf2;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, "Helvetica Neue", Arial, sans-serif;
  padding: 32px;
  max-width: 760px;
  margin-inline: auto;
}

h1 {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.02em;
  margin-bottom: 4px;
}

.subtitle {
  color: var(--dim);
  font-size: 13px;
  margin-bottom: 24px;
}

.controls {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

button {
  background: var(--fg);
  color: var(--bg);
  border: none;
  border-radius: 6px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

button:disabled {
  opacity: 0.35;
  cursor: default;
}

#status {
  font-size: 12px;
  color: var(--dim);
}

section {
  border-top: 1px solid var(--line);
  padding-top: 14px;
  margin-top: 14px;
}

label {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--dim);
  margin-bottom: 6px;
}

.text-box {
  min-height: 20px;
  font-size: 14px;
  line-height: 1.5;
  word-wrap: break-word;
}

#interim { color: var(--dim); font-style: italic; }

#log {
  display: flex;
  flex-wrap: nowrap;
  gap: 4px;
  overflow-x: auto;
  padding: 8px 0;
}

.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
  color: #0b0b0d;
  flex: none;
}

.chip-VOWEL { background: var(--vowel); }
.chip-SOFT { background: var(--soft); }
.chip-SHARP { background: var(--sharp); }
.chip-HARD { background: var(--hard); }
.chip-VOICE { background: #ffffff; }
.chip-STUTTER { background: #bb86fc; }
.chip-REVERSE { background: #ff8a65; }
.chip-SLOWMO { background: #4db6ac; }

.slider-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.slider-row input[type="range"] {
  flex: 1;
}

.slider-row .value {
  font-size: 12px;
  color: var(--dim);
  width: 64px;
  text-align: right;
}

#keyboard {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.key {
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
  color: #0b0b0d;
  border: none;
  cursor: pointer;
}

.key-VOWEL { background: var(--vowel); }
.key-SOFT { background: var(--soft); }
.key-SHARP { background: var(--sharp); }
.key-HARD { background: var(--hard); }

.legend {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--dim);
}

.legend span.dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 5px;
}
