:root {
  --bg: #0f1014;
  --panel: #1b1c24;
  --border: #2c2d3a;
  --accent: #e6503c;
  --text: #e9e9ee;
  --dim: #9aa0ad;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  min-height: 100vh;
  padding: 28px 16px;
  background: radial-gradient(1200px 600px at 50% -10%, #1a1c26, var(--bg));
  color: var(--text);
  font-family: system-ui, "Segoe UI", "Microsoft YaHei", sans-serif;
}

.app-header h1 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 3px;
}

.app-header h1 span {
  color: var(--accent);
}

.app-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.screen-wrap {
  position: relative;
  border: 4px solid var(--border);
  border-radius: 10px;
  background: #000;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

.screen-wrap.dragging {
  border-color: var(--accent);
}

#screen {
  display: block;
  width: min(768px, calc(100vw - 48px));
  aspect-ratio: 256 / 240;
  background: #000;
  image-rendering: pixelated;
}

.drop-hint {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px;
  color: var(--dim);
  text-align: center;
  pointer-events: none;
}

.drop-hint-title {
  font-size: 18px;
  color: var(--text);
}

.drop-hint.hidden {
  display: none;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.btn {
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--panel);
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
  user-select: none;
}

.btn:hover:not(:disabled) {
  border-color: var(--accent);
}

.btn:disabled {
  opacity: 0.45;
  cursor: default;
}

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

.volume {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--dim);
  font-size: 13px;
}

input[type="range"] {
  accent-color: var(--accent);
}

.status {
  min-height: 18px;
  color: var(--dim);
  font-size: 13px;
}

.status.error {
  color: #ff7a66;
}

.help {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.keys {
  border-collapse: collapse;
  color: var(--dim);
  font-size: 13px;
}

.keys th,
.keys td {
  border: 1px solid var(--border);
  padding: 5px 14px;
}

.keys th {
  color: var(--text);
  font-weight: 600;
}

.note {
  max-width: 640px;
  color: #6f7480;
  font-size: 12px;
  line-height: 1.6;
  text-align: center;
}

.screen-wrap:fullscreen {
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 0;
}

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