/* illusionary styles
   Dark UI, monospace, pixel-rendered canvas. Desktop-only scope.
*/

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: #111;
  color: #ccc;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.4;
}

.container {
  max-width: 880px;
  margin: 0 auto;
  padding: 16px;
}

header {
  text-align: center;
  margin-bottom: 8px;
}

header h1 {
  font-size: 18px;
  margin: 0 0 4px 0;
  color: #eee;
  letter-spacing: 0.05em;
}

header .subtitle {
  margin: 0;
  color: #888;
  font-size: 12px;
}

#screen {
  display: block;
  margin: 16px auto;
  width: 720px;
  height: 720px;
  background: #000;
  border: 1px solid #333;
  /* Pixel-perfect upscaling; both keywords for cross-browser coverage. */
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  image-rendering: -moz-crisp-edges;
}

#controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.ctrl-group {
  background: #1b1b1b;
  border: 1px solid #2a2a2a;
  border-radius: 4px;
  padding: 10px;
}

.ctrl-group h3 {
  margin: 0 0 8px 0;
  font-size: 12px;
  color: #9cf;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: normal;
  border-bottom: 1px solid #2a2a2a;
  padding-bottom: 4px;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

button {
  background: #222;
  color: #ccc;
  border: 1px solid #333;
  padding: 4px 8px;
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
  border-radius: 3px;
  transition: background 80ms, border-color 80ms;
}

button:hover {
  background: #2a2a2a;
  border-color: #444;
}

button.active {
  background: #2c4a6a;
  border-color: #4a8;
  color: #fff;
}

label.inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-right: 12px;
  cursor: pointer;
}

input[type="checkbox"] {
  accent-color: #4a8;
}

input[type="range"] {
  width: 100px;
  vertical-align: middle;
}

.readout {
  display: inline-block;
  min-width: 32px;
  text-align: right;
  color: #9cf;
}

.mqtt-row {
  display: flex;
  gap: 4px;
}

#mqtt-input {
  flex: 1;
  background: #0a0a0a;
  border: 1px solid #333;
  color: #ddd;
  padding: 4px 6px;
  font-family: inherit;
  font-size: 12px;
  border-radius: 3px;
}

select {
  background: #0a0a0a;
  border: 1px solid #333;
  color: #ddd;
  padding: 4px 6px;
  font-family: inherit;
  font-size: 12px;
  border-radius: 3px;
  cursor: pointer;
}

select:disabled {
  opacity: 0.5;
  cursor: wait;
}

#mqtt-input.error {
  border-color: #f44;
  background: #2a0e0e;
}

.error-msg {
  margin: 6px 0 0 0;
  color: #f66;
  font-size: 11px;
  min-height: 14px;
}

footer {
  margin-top: 16px;
  text-align: center;
  color: #666;
}

footer code {
  background: #1b1b1b;
  padding: 2px 6px;
  border-radius: 3px;
  color: #9cf;
}

.hint {
  font-size: 11px;
}
