:root {
  --bg: #0c0e14;
  --surface: #151924;
  --surface-alt: #1d2333;
  --border: #2a334a;
  --text: #e6ebf5;
  --muted: #8f9bb3;
  --accent: #55ffff;
  --accent-warm: #ffff55;
  --danger: #ff5555;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 13px;
}

.app-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  max-width: 1360px;
  margin: 0 auto;
  padding: 12px 16px 16px;
  gap: 10px;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.brand-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--accent-warm);
  letter-spacing: 0.04em;
}

.brand-sub {
  font-size: 11px;
  color: var(--muted);
}

.toolbar-groups {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.group {
  display: flex;
  align-items: center;
  gap: 5px;
  padding-right: 8px;
  border-right: 1px solid var(--border);
}

.group:last-child {
  padding-right: 0;
  border-right: none;
}

button,
select {
  background: var(--surface-alt);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 4px 8px;
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
}

button:hover,
select:hover {
  border-color: var(--accent);
}

button:active {
  transform: translateY(1px);
}

button.primary {
  background: #0044aa;
  border-color: #3377dd;
  color: #ffffff;
}

button.primary:hover {
  border-color: var(--accent);
}

label.ctrl {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  font-size: 11px;
}

.stage {
  position: relative;
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000000;
  border: 2px solid var(--border);
  border-radius: 8px;
  padding: 8px;
  min-height: 380px;
  overflow: hidden;
  outline: none;
}

.stage:focus,
.stage:focus-within {
  border-color: #3a6ea5;
}

.stage:fullscreen {
  border: none;
  border-radius: 0;
  padding: 0;
  background: #000000;
}

#screen {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 170px);
  width: auto;
  height: auto;
  background: #000000;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  cursor: pointer;
}

.stage:fullscreen #screen {
  max-width: 100vw;
  max-height: 100vh;
}

.drop-overlay {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 170, 0.78);
  border: 3px dashed var(--accent-warm);
  color: #ffffff;
  font-size: 18px;
  font-weight: 700;
  pointer-events: none;
  z-index: 10;
}

.stage.dragging .drop-overlay {
  display: flex;
}

.banner {
  display: none;
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 12px;
  line-height: 1.45;
}

.banner.visible {
  display: block;
}

.banner.error {
  border-color: var(--danger);
  background: #2a1216;
  color: #ffd6d6;
}

.banner code {
  background: rgba(255, 255, 255, 0.08);
  padding: 1px 4px;
  border-radius: 3px;
}

.footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--muted);
  font-size: 11px;
}

.status-line strong {
  color: var(--accent);
  font-weight: 600;
}

.controls-hint kbd {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 1px 4px;
  color: var(--text);
  font-family: inherit;
  font-size: 11px;
}
