@font-face {
  font-family: "Bedstead";
  src: url("/static/vendor/bedstead-extended.otf") format("opentype");
  font-display: block;
}

:root {
  --bg: #000;
  --panel: #111;
  --btn: #222;
  --btn-hi: #333;
  --fg: #fff;
  --muted: #9a9a9a;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--fg);
  font-family: "Bedstead", monospace;
}

#app {
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  padding: 16px;
}

#screen-wrap { position: relative; }

#term {
  line-height: 0;
}
#term .xterm-viewport { overflow: hidden !important; background: #000 !important; }
#term .xterm { padding: 0; }

#overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: rgba(0, 0, 0, .85);
  font-size: 18px;
}
#overlay[hidden] { display: none; }
#overlay button, #remote button {
  font: inherit;
  color: var(--fg);
  background: var(--btn);
  border: 1px solid #444;
  border-radius: 6px;
  cursor: pointer;
}
#overlay button { padding: 10px 18px; }
#overlay button:hover, #remote button:hover { background: var(--btn-hi); }

#remote {
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: var(--panel);
  border: 1px solid #2a2a2a;
  border-radius: 18px;
  padding: 16px;
  width: 200px;
  flex: none;
}
#remote button { height: 40px; font: 600 17px system-ui, sans-serif; touch-action: manipulation; }
.pad, .arrows { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.fast { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.fast button { border: none !important; height: 28px !important; }
.fast .red { background: #ff0000 !important; }
.fast .green { background: #00ff00 !important; }
.fast .yellow { background: #ffff00 !important; }
.fast .cyan { background: #00ffff !important; }
.hint { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.5; text-align: center; }
.hint code { color: #0f0; font-family: inherit; }

@media (max-width: 900px) {
  #app { flex-direction: column; justify-content: flex-start; gap: 16px; }
  #remote {
    width: 100%;
    max-width: 520px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-areas: "pad arrows" "fast fast" "hint hint";
  }
  .pad { grid-area: pad; }
  .arrows { grid-area: arrows; align-content: center; }
  .fast { grid-area: fast; }
  .hint { grid-area: hint; }
}
