/* The editor draws everything itself on one canvas; the page only holds the canvas, a hidden
   text input (what the keyboard and the input methods type into), and a few messages. */
:root {
  color-scheme: light dark;
  --page: #f4f4f6;
  --text: #1f2937;
  --panel: #ffffff;
  --border: #d1d5db;
  --accent: #2563eb;
  --danger-bg: #fef2f2;
  --danger-text: #991b1b;
}

@media (prefers-color-scheme: dark) {
  :root {
    --page: #1a1a1c;
    --text: #e5e7eb;
    --panel: #26272b;
    --border: #3f4148;
    --accent: #60a5fa;
    --danger-bg: #3b1d1d;
    --danger-text: #fecaca;
  }
}

html,
body {
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--page);
  color: var(--text);
  font: 14px/1.4 system-ui, sans-serif;
}

#screen {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  outline: none;
  -webkit-user-select: none;
  user-select: none;
}

/* Present and focusable, invisible: dead keys, composed characters and the paste event of the
   browser need a real text input to land in. */
.text-input {
  position: fixed;
  left: 0;
  top: 0;
  width: 1px;
  height: 16px;
  padding: 0;
  border: 0;
  margin: 0;
  opacity: 0;
  resize: none;
  overflow: hidden;
  background: transparent;
  color: transparent;
  caret-color: transparent;
  pointer-events: none;
  font-size: 16px;
}

.boot {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--page);
}

.boot[hidden] {
  display: none;
}

.notice {
  position: fixed;
  left: 50%;
  bottom: 40px;
  transform: translateX(-50%);
  max-width: min(720px, calc(100vw - 32px));
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--danger-bg);
  color: var(--danger-text);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  overflow-wrap: anywhere;
}

.notice[hidden],
.floating[hidden] {
  display: none;
}

button {
  font: inherit;
  padding: 4px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
}

button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.floating {
  position: fixed;
  left: 50%;
  top: 56px;
  transform: translateX(-50%);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.floating.zip {
  top: 96px;
  font-size: 12px;
}
