* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 20px 28px 48px;
  background-color: #f4f5f7;
  color: #1b1f24;
  font-family: -apple-system, "Segoe UI", Arial, sans-serif;
}

h1 {
  margin: 8px 0 4px;
  font-size: 22px;
}

h2 {
  margin: 0 0 8px;
  font-size: 13px;
  color: #6b7280;
  text-transform: uppercase;
}

code {
  background-color: #eef0f2;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 12px;
}

.back-link {
  color: #1f6feb;
  font-size: 13px;
  text-decoration: none;
}

.subtitle {
  margin: 0 0 20px;
  color: #6b7280;
  font-size: 14px;
}

.layout {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: flex-start;
}

.screen-column {
  flex: 1 1 640px;
  min-width: 0;
}

.controls-column {
  flex: 0 1 380px;
}

.tv-screen {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background-color: #202226;
  border-radius: 8px;
}

.state-panel {
  margin-top: 14px;
  padding: 12px 14px;
  background-color: #ffffff;
  border: 1px solid #dde1e6;
  border-radius: 8px;
}

.state-panel pre {
  margin: 0;
  font-size: 12px;
  white-space: pre-wrap;
}

fieldset {
  margin: 0 0 14px;
  padding: 10px 14px 12px;
  background-color: #ffffff;
  border: 1px solid #dde1e6;
  border-radius: 8px;
}

legend {
  padding: 0 4px;
  font-size: 13px;
  font-weight: 700;
}

label {
  display: block;
  margin: 6px 0;
  font-size: 13px;
}

label.inline {
  display: inline-block;
  margin-right: 12px;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

button {
  padding: 5px 10px;
  font-family: monospace;
  font-size: 12px;
  cursor: pointer;
}

.event-log {
  max-height: 180px;
  margin: 0;
  padding-left: 22px;
  overflow-y: auto;
  font-family: monospace;
  font-size: 12px;
}

.event-error {
  color: #cf222e;
}

textarea {
  display: block;
  width: 100%;
  margin-top: 3px;
  font-family: monospace;
  font-size: 12px;
}

/* The module is laid out in a real 1280x720 application area, scaled to
   fit the screen box by harness.js. */
.app-area {
  position: absolute;
  left: 0;
  top: 0;
  width: 1280px;
  height: 720px;
  transform-origin: 0 0;
}

/* Same box as the ResultsBox region (tester UI style), drawn by the harness
   only, to see where the panel may be. */
.region-outline {
  position: absolute;
  right: 5%;
  top: 5%;
  width: 43%;
  height: 64%;
  border: 2px dashed #8cc8ff;
  pointer-events: none;
}

.region-outline-hidden {
  display: none;
}

.hint {
  margin: 8px 0 0;
  color: #6b7280;
  font-size: 12px;
}
