body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  font-family: Arial, sans-serif;
  background-color: #f5f5f5;
  color: #333;
  transition: background 0.3s, color 0.3s;
}

main {
  display: flex;
  width: 100%;
  height: calc(100% - 50px);
  gap: 10px; /* spacing */
  padding: 10px;
  box-sizing: border-box;
}

ul.ui {
  height: 100px;
  width: auto;
  overflow: auto;
  border-style: groove;
  padding: 5px;
}

button.ui {
  padding: 0.5rem 1rem;
  border: none;
  cursor: pointer;
  margin-right: 5px;
  margin-bottom: 5px;
  max-height: 3em;
}

select.ui {
  padding: 0.5rem 1rem;
  border: none;
  cursor: pointer;
  margin-right: 5px;
  margin-down: 5px;
}

#input {
  width: 50%;
  height: 100%;
  border: none;
  resize: vertical;
  outline: none;
  padding: 1rem;
  background: #fff;
  font-family: monospace;
  tab-size: 4;
}

#preview {
  width: 50%;
  padding: 1rem;
  overflow-y: auto;
  background: #f9f9f9;
  border-left: 1px solid #ccc;
}

#input, #preview {
  min-width: 45%;
  flex: 1;
}

#toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0.5rem;
  background: #ddd;
}

#timer-controls {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

#resume-timer {
  display: none;
}

details {
  color: black;
  position: relative;
}

details summary {
  cursor: pointer;
  padding: 0.5rem 1rem;
  background: #eee;
}

details[open] ul {
  position: absolute;
  background: white;
  border: 1px solid #ccc;
  padding: 10px;
  list-style: none;
  margin-top: 5px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

#error-output {
  color: red;
  font-size: 0.9rem;
  margin-top: 5px;
}

.character-image {
  display: inline-block;
  height: 1em;
  vertical-align: middle;
  max-width: 100%;
  line-height: 1;
  transition: transform 0.2s ease;
}

.character-image:hover {
  transform: scale(1.1);
}

.dark-mode {
  background: #222;
  color: #fff;
}

.dark-mode #input {
  background: #333;
  color: #fff;
}

.dark-mode #preview {
  background: #444;
}

.dark-mode #toolbar {
  background: #555;
  color: #fff;
}

