body {
  margin: 0;
  overflow: hidden;
  background: #fbfbfb;
}

canvas {
  display: block;
  touch-action: none;
}

#ui {
  position: fixed;
  top: 10px;
  left: 10px;
  background: white;
  padding: 10px;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  z-index: 10;
}

textarea {
  width: 250px;
  height: 300px;
  resize: vertical;
  font-family: monospace;
  font-size: 14px;
}


button {
  margin-top: 5px;
  width: 100%;
  padding: 5px;
  cursor: pointer;
}


#controls {
    position: absolute;
    left: 20px;
    top: 20px;

    display: flex;
    flex-direction: column;   /* stack vertically */
    gap: 8px;                 /* space between items */
}

#edgeInput {
    width: 250px;
    height: 120px;   /* make it taller */
    font-family: monospace;
}

#controls label {
    font-size: 14px;
}

/* Default desktop */

#controls textarea {
  width: 260px;
  height: 140px;
  font-family: monospace;
  font-size: 16px;
}

#controls label {
  font-size: 14px;
}


/* ========================= */
/* ===== MOBILE LAYOUT ===== */
/* ========================= */
@media (max-width: 768px) {

  html, body {
    margin: 0;
    height: 100vh;       /* lock to viewport */
    overflow: hidden;    /* prevent page scroll */
  }

  body {
    display: flex;
    flex-direction: column;
  }

  /* Controls on top */
  #controls {
    position: relative !important;
    left: auto !important;
    top: auto !important;

    width: 100%;
    box-sizing: border-box;
    padding: 12px;

    background: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    z-index: 10;
  }

  #canvas {
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    display: block;
  }

}

